1

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.

John Smith
  • 187
  • 7

1 Answers1

0

it should work if you add the appropriate flag in this case N as follows:

daemon -N 5 --user myUser  etc...
c0d3junk13
  • 1,162
  • 9
  • 6
  • Same result as before. The daemon still doesn't run at all even with the -N flag. I tried different flags as well before, but with the same result. – John Smith Feb 07 '14 at 17:27