Stop Apache for 2 minutes at 11 am daily

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?

5 Replies

Hello,

You can suspend and resume processes with:

kill -TSTP $PIDOFPROCESS

kill -CONT $PIDOFPROCESS

I hope this helps!

Thanks but if I stop won't Lassie initiated reboot come into action?

sohsoh5 shouldn't I use -STOP rather than TSTP ?

TSTP does not work. This is working fine in the crontab:

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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct