Monit can't start the process

I have a simple script that I'm trying to get Monit to control. After some digging around, I found this little nugget: start program = "su - myuser -c '/home/user/myscript.rb start' "which, I believe, should work, but looking at the log files, it says:

[PDT Oct 30 02:47:17] info     : 'simple_script' start: su
[PDT Oct 30 02:47:17] error    : Error: Could not execute su

Similarly, earlier attempts only seem to be read by the part preceding the space, therefore:

start program = "/home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /home/user/simple_script_daemon.rb stop"

leads to...

[PDT Oct 30 03:09:49] info     : 'simple_script' start: /home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby

This does not work, as in the first example, but still, it seems, only the part preceding the space is completed.

This is my complete statement:

check process simple_script
    with pidfile /home/user/simple_script.rb.pid
    start program = "su - user -c '/home/user/simple_script_daemon.rb start' "
    stop program = "su - user -c '/home/user/simple_script_daemon.rb stop' "
    group simple_script

If you have an idea what might happen, I would love to hear from you!

+5
source share
2 answers

, - :

check process simple_script
    with pidfile /home/user/simple_script.rb.pid
    start program = "/home/user/simple_script_daemon.rb start" as uid user and gid user
    stop program = "/home/user/simple_script_daemon.rb stop" as uid user and gid user
    group simple_script

monit doc.

+7

su, /bin/su

+4

All Articles