View previous topic :: View next topic |
Author |
Message |
Seather Apprentice
Joined: 23 May 2003 Posts: 194 Location: South Africa
|
Posted: Mon Oct 09, 2006 2:52 am Post subject: Remotely restarting all services |
|
|
Hi there,
What is the best way to remotely restart all services? Like running `/etc/init.d/* stop` and then `/etc/init.d/* start` again? But in a safe way since physical access is a 3 hour drive away?
Thanks |
|
Back to top |
|
|
jlg Guru
Joined: 31 May 2002 Posts: 360 Location: Montreal, CANADA
|
Posted: Mon Oct 09, 2006 3:21 am Post subject: |
|
|
I would say in a "screen" session through ssh. _________________ The only real voyage of discovery consists not in seeking new landscapes, but in having new eyes! |
|
Back to top |
|
|
Seather Apprentice
Joined: 23 May 2003 Posts: 194 Location: South Africa
|
Posted: Mon Oct 09, 2006 3:57 am Post subject: |
|
|
Doing every single one manually? |
|
Back to top |
|
|
jlg Guru
Joined: 31 May 2002 Posts: 360 Location: Montreal, CANADA
|
Posted: Mon Oct 09, 2006 4:26 am Post subject: |
|
|
If you want to stop and restart all the services wouldn't you be better off just rebooting the machine? _________________ The only real voyage of discovery consists not in seeking new landscapes, but in having new eyes! |
|
Back to top |
|
|
Janne Pikkarainen Veteran
Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Mon Oct 09, 2006 12:57 pm Post subject: |
|
|
"Restart all the services easily" and "Safe" do not click together. It's better to do that one by one and check that everything still works, especially when the other option would be that three hours drive. Please remember that all kinds of boot-related scripts are located in /etc/init.d/ among the run-time services, and force-restarting those boot-related scripts in-flight can lead to all kind of ... hrm... interesting results.
But you may of course create a script like
Code: | for each in apache mysql postfix; { /etc/init.d/$each restart; } |
which would restart Apache, MySQL and Postfix. Doing a thing like that is always a bit risky and I prefer to do things like this in a more safe, although more time-consuming way, and restart the needed service one-by-one after an upgrade or a similar event. _________________ Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.". |
|
Back to top |
|
|
the_mole n00b
Joined: 14 Jan 2005 Posts: 64 Location: Erlangen, Germany
|
Posted: Mon Oct 09, 2006 2:28 pm Post subject: |
|
|
Hm, only the network interface should be the problem. If it doesn't restart, then you need to drive
SSH for example holds running connections while restarting. _________________ The software required Windows 98/2000/XP or better... So I installed Linux |
|
Back to top |
|
|
|