Stop Apache for 2 minutes at 11 am daily
The problem is that if I halt them then the Linode automatically reboots.
How to halt/suspend these two without causing system to reboot?
5 Replies
You can suspend and resume processes with:
kill -TSTP $PIDOFPROCESS
kill -CONT $PIDOFPROCESS
I hope this helps!
0 11 * * * /usr/bin/killall -STOP /usr/sbin/apache2
3,5,55 11 * * * /usr/bin/killall -CONT /usr/sbin/apache2
9 11,12,13 * * * /usr/bin/killall -CONT /usr/sbin/apache2
@rag_gupta:
Something urgent runs on my VPS exactly at 11 am for 2 crucial minutes. So for 2 minutes I just want to halt the Apache & Mysql . The problem is that if I halt them then the Linode automatically reboots.
How to halt/suspend these two without causing system to reboot?
Just stopping Apache and MySQL should not make your system to reboot.
You can do this in a cron job at 11 am
service apache2 stop
service mysql stop
and this at 11:02 am
service apache2 start
service mysql start
Or maybe I'm missing anything.