I'm new to linux, and I have an script in etc/init.d which launches a daemon everytime my AWS EC2 linux server starts. So far everything is peachy except that the daemon I have needs to launch at a slightly lower priority. I've searched everywhere for an answer on this but to no avail. Here's a snippet:
OPTIONS=" -p 49494"
prog=/home/myUser/myApp/bin/app
progName=myApp
lockfile=/var/-*lock/subsys/$progName
start() {
[ "$EUID" != "0" ] && exit 4
[ "$NETWORKING" = "no" ] && exit 1
[ -x $prog ] || exit 5
# Start daemon.
echo -n $"Starting $progName: "
daemon --user myUser --pidfile /var/run/myApp.pid $prog $OPTIONS &
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
The issue is that I can't seam to launch the daemon with a priority of 5. If I put
daemon -5 --user myUser etc...
Then the daemon lauches without any issues with a -5 priority. However if I put a positive number in place
daemon 5 --user myUser etc...
then the daemon doesn't launch. I also get no notifications in any of the logs about what is going on.
Any ideas why -5 works but 5 doesn't?
p.s. I didn't write the original file, so I'd like to alter it as little as possible since its currently working fine.