Skip to content

buganini/rcexecr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rcexecr is modified from rcorder(8) from freebsd(/netbsd)

It aims to do things that rcorder and part of /etc/rc do in parallel.

Test with modification on /etc:
	#install
	cd /usr/src/sbin/
	git clone git://github.com/buganini/rcexecr.git
	cd rcexecr
	sudo make all install

	#patch /etc
	cd /etc/
	patch -p1 < /usr/src/sbin/rcexecr/etc.patch.txt

	#enable parallel execution
	echo rcexecr_parallel="YES" >> /etc/rc.conf

	#reboot
	shutdown -r now

Test without affecting system:
	cd /usr/src/sbin/
	git clone git://github.com/buganini/rcexecr.git
	cd rcexecr
	sudo make

	env ARG0=\? ARG1=start./rcexecr /etc/rc.d/*
	env ARG0=\? ARG1=stop ./rcexecr -r /etc/rc.d/*

	#add -x to actually execute
	env ARG0=\? ./rcexecr -x testcase/rc.d/*

	#test self modification
	chmod -R 755 testcase/
	env ARG0=\? ./rcexecr -x testcase/rc.d/*

Progress:
	beg/end calculation: done
	fork/exec/waitpid/-x(execute, or dry print): done
	-r(reverse, for /etc/rc.shutdown): done
	self modification: done
	patch for /etc: done
	update document: partial

Concept:
	beg/end: the proper timing to launch script / wait it finished.
	When a node's requirement is satisfied, it would be launched by fork()+exec().
	When a node is required to be done, it would be waited for by waitpid().

	the whole schedule is reversed with -r.

	Circular dependency detecting:
		see https://github.com/buganini/rcexecr/commit/8460c6006dd041fe4920047ee80c3bd19896f493

	Self modification:
		consider the dependencies as a graph, the files as nodes,
		when subprocess exec(rcexecr), the node take whole graph as input,
		and regenerate it with adding new node.
		approach:
			if (getenv("RCEXECR")!=NULL) {
				//send new items to the nexus by writing to pipe.
				exit(0);
			} else {
				setenv("RCEXECR", pipe-fd);
			}
			after receiving new items, call regenerate(),
			which exit() directly.

Todo:
	zombieskiller (but this need another mapping and lookup)

About

Parallel rc.d scripts executer for FreeBSD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages