0

I'm new on ServerFault.

I'm using monit to start/stop/monitoring services on RHEL7.

Sometime I need to stop the monit daemon (for upgrade it or othen reasons). But when I stop the monit daemon (systemctl stop monit ; also tried kill -9 ) monit does stop all processes started with him, regardless the monit configuration and regardless the stop script.

Example:

check process apache with pidfile /opt/apache24-p1/logs/httpd.pid start program "/opt/apache24-p1/bin/apachectl start" #stop program "/opt/apache24-p1/bin/apachectl stop" #mode passive

monit start apache then systemctl stop monit causes stop httpd daemons without call apachectl

the same uncommenting "mode passive" also monit unmonitor all systemctl stop monit causes stop httpd

also

monit start apache rm /etc/monit.d/apache monit reload systemctl stop monit causes stop httpd

note that parent pid of httpd is not monit.

There is a way to stop monit without stop the service?

Thankyou.

  • Please check your main process and dependency of them with pstree command . If you have dependency on them . No way they call each other and if you stop one process another cannot work – MohammadReza moeini Oct 06 '20 at 15:12
  • Why do you use monit? It's mostly redundant now. – Michael Hampton Oct 06 '20 at 18:37
  • There are not dependecies. httpd is a child of systemd. strace show that the httpd process receive a sigterm&&sigchld&&sigcont from systemd. I found the httpd pid in /sys/fs/cgroup/systemd/system.slice/monit.service/cgroup.procs – ZeroUno Oct 07 '20 at 12:50

0 Answers0