Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Remotely restarting all services
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Seather
Apprentice
Apprentice


Joined: 23 May 2003
Posts: 194
Location: South Africa

PostPosted: Mon Oct 09, 2006 2:52 am    Post subject: Remotely restarting all services Reply with quote

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
View user's profile Send private message
jlg
Guru
Guru


Joined: 31 May 2002
Posts: 360
Location: Montreal, CANADA

PostPosted: Mon Oct 09, 2006 3:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Seather
Apprentice
Apprentice


Joined: 23 May 2003
Posts: 194
Location: South Africa

PostPosted: Mon Oct 09, 2006 3:57 am    Post subject: Reply with quote

Doing every single one manually?
Back to top
View user's profile Send private message
jlg
Guru
Guru


Joined: 31 May 2002
Posts: 360
Location: Montreal, CANADA

PostPosted: Mon Oct 09, 2006 4:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Mon Oct 09, 2006 12:57 pm    Post subject: Reply with quote

"Restart all the services easily" and "Safe" do not click together. :D 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
View user's profile Send private message
the_mole
n00b
n00b


Joined: 14 Jan 2005
Posts: 64
Location: Erlangen, Germany

PostPosted: Mon Oct 09, 2006 2:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum