/usr/local/etc/rc.d and role accounts

Mike Hunter mhunter at ack.berkeley.edu
Fri Apr 14 16:35:59 UTC 2006


I'm hoping to get into the spirit of the new rc.d script specs (REQUIRES,
PROVIDES, command=, etc) on a new server I'm building.  The old script I
was using looked like this:


[ -x /usr/local/bin/foo ] && su foo-role -c "/usr/local/bin/foo bar"
[ -x /usr/local/bin/foo ] && su foo-role -c "/usr/local/bin/foo baz"
[ -x /usr/local/bin/foo ] && su foo-role -c "/usr/local/bin/foo bof"

I have several questions about how to replicate this behavior.  I'm still
deciding whether I'm willing to split out the 10 or so instances into
separate scripts...if I didn't want to do that, is the best way to handle
it to create a script with all 10 command and then have the rc script run
that script?

How do I replicate the su stuff?  I could say command=su and
foo_flags="foo-role -c ..." but that doesn't seem very good.

As a bonus, foo would like to make pid files, but /var/run isn't writable to
foo-role.  What's the standard way to handle where to put the pid files?



More information about the freebsd-questions mailing list