diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2009-03-31 12:06:52 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2009-03-31 12:06:52 +0000 |
commit | 0ef12d48dbd4e2f1a03cd6c7f0f1504587f71807 (patch) | |
tree | 57a1e710dea1a2481945b4e1abe06ff5d669dec3 /testing/gross-svn/gross-svn.initd | |
parent | 53daaab1e0f7bcb8de3936bfb2771e6a969135a4 (diff) | |
download | aports-0ef12d48dbd4e2f1a03cd6c7f0f1504587f71807.tar.bz2 aports-0ef12d48dbd4e2f1a03cd6c7f0f1504587f71807.tar.xz |
testing/gross-svn: run as user gross
Diffstat (limited to 'testing/gross-svn/gross-svn.initd')
-rw-r--r-- | testing/gross-svn/gross-svn.initd | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/testing/gross-svn/gross-svn.initd b/testing/gross-svn/gross-svn.initd index 677d44997f..c67293e17f 100644 --- a/testing/gross-svn/gross-svn.initd +++ b/testing/gross-svn/gross-svn.initd @@ -1,31 +1,35 @@ #!/sbin/runscript -NAME=grossd -DAEMON=/usr/sbin/$NAME +NAME="grossd" +DAEMON="/usr/sbin/$NAME" +USER="gross" +GROUP="gross" depend() { - need net + need net } check_config() { - if [ ! -e /var/db/gross/ ] ; then - einfo "Generating Gross database..." - install -dD -o${USER} -g${GROUP} /var/db/gross - ${DAEMON} -Cf /etc/grossd.conf > /dev/null - fi + if [ ! -f /var/db/gross/state ] ; then + einfo "Generating Gross database..." + install -dD -o${USER} -g${GROUP} /var/db/gross + ${DAEMON} -Cu ${USER} > /dev/null + fi } start() { - check_config || return 1 - ebegin "Starting ${NAME}" - start-stop-daemon --start --quiet --background \ - --exec ${DAEMON} -- ${OPTS} - eend $? + check_config || return 1 + ebegin "Starting ${NAME}" + start-stop-daemon --start --quiet --background \ + --exec ${DAEMON} -- \ + -p /var/run/gross/grossd.pid \ + -u ${USER} ${OPTS} + eend $? } stop() { - ebegin "Stopping ${NAME}" - start-stop-daemon --stop --pidfile /var/run/grossd/grossd.pid - eend $? + ebegin "Stopping ${NAME}" + start-stop-daemon --stop --pidfile /var/run/gross/grossd.pid + eend $? } |