Port startup scripts under rcNG?

Scot W. Hetzel hetzels at westbend.net
Tue May 13 20:30:37 PDT 2003


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



More information about the freebsd-current mailing list