support for running as an alternate OS user (defaults to root)

This commit is contained in:
Mike Bonnet 2007-05-29 11:32:03 -04:00
parent d4b5499f38
commit ee796d4add
2 changed files with 6 additions and 1 deletions

View file

@ -35,7 +35,11 @@ start() {
[ "$FORCE_LOCK" == "Y" ] && ARGS="$ARGS --force-lock"
[ "$KOJIRA_DEBUG" == "Y" ] && ARGS="$ARGS --debug"
[ "$KOJIRA_VERBOSE" == "Y" ] && ARGS="$ARGS --verbose"
daemon /usr/sbin/kojira $ARGS
if [ -n "$RUNAS" -a "$RUNAS" != "root" ]; then
daemon --user "$RUNAS" /usr/sbin/kojira $ARGS
else
daemon /usr/sbin/kojira $ARGS
fi
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/kojira

View file

@ -1,3 +1,4 @@
FORCE_LOCK=Y
KOJIRA_DEBUG=N
KOJIRA_VERBOSE=Y
RUNAS=root