monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange "program/file does not exist" error


From: Steven Christensen
Subject: Strange "program/file does not exist" error
Date: Wed, 9 Apr 2025 17:50:30 -0400

I have a new Ubuntu VM and I installed monit (version 5.33.0). I am well-versed with monit, and run it on multiple platforms.

Anyway, I have a simple configuration to check for the existence of a process, and if it is missing, start it.

Here is the configuration
=====================================
check process udptunnel matching "127.0.0.1:21116"
      start program = "/root/start_udptunnel.sh" with timeout 15 seconds
      stop program = "/usr/bin/pkill -f 'udptunnel -s 21000'"
=====================================

The start_udptunnel.sh script looks like this:
=====================================
#!/bin/bash -x

echo "Starting" | ts >> /tmp/udptunnel.log
/usr/local/sbin/udptunnel -s 21000 127.0.0.1:21116 -v 2>&1 | ts >> /tmp/udptunnel.log &
exit 0
=====================================

Everything works when I invoke start_udptunnel.sh manually. The permissions on start_udptunnel.sh are appropriate.

However, when I start up monit, this is in the log:
=====================================
[2025-04-09T16:21:08+0000] info     : Reinitializing monit daemon
[2025-04-09T16:21:08+0000] info     : Reinitializing Monit -- control file '/etc/monit/monitrc'
[2025-04-09T16:21:09+0000] warning  : /etc/monit/conf-enabled/udptunnel:2: Program does not exist: '/root/start_udptunnel.sh'
[2025-04-09T16:21:09+0000] info     : 'xxxxxxxx.com' Monit reloaded
[2025-04-09T16:21:20+0000] error    : 'udptunnel' process is not running
[2025-04-09T16:21:21+0000] info     : 'udptunnel' trying to restart
[2025-04-09T16:21:21+0000] info     : 'udptunnel' start: '/root/start_udptunnel.sh'
[2025-04-09T16:21:21+0000] error    : 'udptunnel' failed to start (exit status -1) -- Program /root/start_udptunnel.sh failed: File '/root/start_udptunnel.sh' does not exist
=====================================

For the life of me I can't figure out why monit says that the script doesn't exist.

I have copied and pasted the script name from the log just to make sure there is no typo.

Am I missing something obvious?

Thanks

reply via email to

[Prev in Thread] Current Thread [Next in Thread]