What seems wrong with this bash script?
I found an initscript that for some reason insists on starting the
specified application as the root user. I can't wrap my head around why it
is doing this, any hints? The script runs on Redhat Enterprise Linux 5.9.
#!/bin/bash
#
# Start/Stop apfe.
#
# chkconfig: - 62 38
# description: apfe
# Start script for an apfe process.
# Apfe does not normally run as root, so we change user
# and call the real script in $USERDIR.
STARTUSER=apfe
USERDIR=/app/apfe/apps/apfeutils/bin
PROGNAME=apfe
su - $STARTUSER -c "$USERDIR/$PROGNAME $*"
No comments:
Post a Comment