Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Apr 2006 15:16:30 -0700
From:      Mike Hunter <mhunter@ack.berkeley.edu>
To:        freebsd-questions@freebsd.org
Subject:   /usr/local/etc/rc.d and role accounts
Message-ID:  <20060413221630.GA50540@malcolm.berkeley.edu>

next in thread | raw e-mail | index | archive | help
Hi,

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:

/usr/local/etc/rc.d/start-all-foo.sh

[ -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?

Thanks!

Mike



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060413221630.GA50540>