rcrun(8): Properly handle scripts that provide more than one keyword. The loop that checks if all dependencies of the target are running didn't take into account that there could be more than one PROVIDE keyword in one script. It treated all PROVIDEs which were not named like the target as not yet running dependencies and failed. To fix, loop through the PROVIDEs twice, the first time to skip all the PROVIDEs of the script if the target is one of them. All this is due to the output of "rcorder -o ..." having the script that provides the target which we want to run as its last element, so document that with a comment. Reported-by: joris
rcrun(8): Teach rcstart, rcstop and friends to handle other rc dirs. This commit makes rcrun(8) and its various incarnations work also with rc scripts that are in either /usr/pkg/etc/rc.d or /usr/local/etc/rc.d (the paths in rc.conf's local_startup, actually). While here, do some cleanup: * Remove some unneeded 'cd' commands (rcorder as we call it will already give the full path to the script) * Remove extra whitespace at the end of the file * Add a copyright.
Repair rcenable(8) and rcdisable(8). * rcenable(8) was not playing nicely with our three year old change to no longer depend on _enable being appended to rc variables for starting daemons etc. (i.e., foo_enable=yes and foo=yes both work). * rcdisable(8) did not properly run rcstop(8) because that needs to be run when the variable is still set to 'yes' and not after it's been set to 'no'. Noticed-by: phma on #dragonflybsd
Add an 'enable' and 'disable' target to rcrun, and add softlink shortcuts for 'rcenable' and 'rcdisable'. These functions will modify rcrun-generated entries in /etc/rc.conf. They will not delete any manual entries in rc.conf even if the manual entry is being overriden. Add additional states to the varsym vars and make rc.subr and rcrun aware of them. The states are now: running failed disabled irrelevant configured stopped