Skip to content
Parallel rc.d scripts executer for FreeBSD
C Shell
Find file


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:
	cd /usr/src/sbin/
	git clone 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

	shutdown -r now

Test without affecting system:
	cd /usr/src/sbin/
	git clone 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/*

	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

	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:

	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.
			if (getenv("RCEXECR")!=NULL) {
				//send new items to the nexus by writing to pipe.
			} else {
				setenv("RCEXECR", pipe-fd);
			after receiving new items, call regenerate(),
			which exit() directly.

	zombieskiller (but this need another mapping and lookup)
Something went wrong with that request. Please try again.