Re: Port startup scripts under rcNG?

From: Scot W. Hetzel <hetzels_at_westbend.net>
Date: Tue, 13 May 2003 22:30:46 -0500
From: "Lucky Green" <shamrock_at_cypherpunks.to>
> What is the correct place in the FreeBSD file system for a Port startup
> script that executes a program as a specific user under rcNG? And where
> can I find a sample of such a script?
>
An example of a combined rcNG/OG script is in security/cyrus-sasl.  Your
rcNG portion of the script may look like the following:

        name="mydaemon"
        rcvar=`set_rcvar`

        mydaemon_user="testuser"
        command="${prefix}/sbin/${name}"
        pidfile="/var/run/${name}.pid"

        load_rc_config $name
        run_rc_command "$1"

by adding mydaemon_user to the rcNG portion of the script, we execute
${command}as that user.  For more info on the variables available to
run_rc_command, look at it's entry in /etc/rc.subr.

Scot
Received on Tue May 13 2003 - 18:30:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:07 UTC