N
N
Nikita Neskuchaev2016-11-01 19:16:45
linux
Nikita Neskuchaev, 2016-11-01 19:16:45

How to write *.sh-script (centos6) for smooth reboot?

Good day! There is a small problem that I can't solve. I use ISPmanager5, in the scheduler I set a scheduled reboot of my server (just lunux with the reboot command). I need to restart the server more smoothly according to the plan:
1. Stop nodeJS
2. Stop MySQL
3. Stop the web server (Apache + PHP)
4. reboot
I have a CentOS x64 system
And I need to reboot when all services have stopped!
Help write *.sh-script.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
Fixid, 2016-11-01
@iamnikas

What actually does not suit the regular reboot? It still sends a regular signal about a regular stop
So you need something like:
service nodejs stop && service mysqld stop && service apache2 stop && reboot

D
Dmitry, 2016-11-01
@Tabletko

Shutdown -r

R
Ruslan Fedoseev, 2016-11-01
@martin74ua

reboot
Everything else will be done by itself :) Read about init and system start/stop order.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question