LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-25-2012, 03:14 AM   #1
vp0619520
Member
 
Registered: Jan 2012
Posts: 55

Rep: Reputation: Disabled
operation before shutdown the server


Hi team ,

I have a question, I want to shutdown the server in order to add some memory.There are several services running in this server:Mysql,apache and so on.I want to konw do I need to stop these services at first before I run the shutdown command
Code:
shutdown -h now
 
Old 05-25-2012, 03:21 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,772

Rep: Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056
according to the man page you do not need to stop services.
 
Old 05-25-2012, 03:24 AM   #3
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Hi there,

On all Linux distributions I've ever used, you don't need to manually shut down services that are in packages supplied by the distro (i.e. in an RPM/DEB/whatever package). They are shut down automatically as part of the system shutdown process when you run "shutdown -h now". This would most certainly apply to services like mysql and apache.

The only things you may need to shut down manually are services that you might have written yourself, or installed in a non-standard way. Even the shutdown for these can be automated by writing startup & shutdown scripts. The exact location for these depends on the distro you are running, though (often /etc/rc.d or /etc/init.d).

I hope this helps. If not, tell us which distro you are running, so someone can try and help with more specific information.

Regards,

Clifford
 
Old 05-25-2012, 03:33 AM   #4
vp0619520
Member
 
Registered: Jan 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cliffordw View Post
Hi there,

The only things you may need to shut down manually are services that you might have written yourself, or installed in a non-standard way. Even the shutdown for these can be automated by writing startup & shutdown scripts. The exact location for these depends on the distro you are running, though (often /etc/rc.d or /etc/init.d).

Clifford
Thanks very much for the rapidly reply! The OS of that server is Ubuntu 9 64bit.I have a glance at the path
Code:
/etc/rc2.d/
I only found some scripts which filename start by "S",but no one start with"K".Dose the system can also stop these services automatically?Actrually there are only three app running in this server mysql,apache2,glassfish.I found first of them are installed in a standard way,and the other I can stop it manually.
 
Old 05-25-2012, 03:39 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,772

Rep: Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056
with those apps you can safely use shutdown
 
Old 05-25-2012, 03:42 AM   #6
vp0619520
Member
 
Registered: Jan 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
with those apps you can safely use shutdown
Ok,I really appreciate that!
 
Old 05-25-2012, 04:07 AM   #7
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Quote:
Originally Posted by vp0619520 View Post
Thanks very much for the rapidly reply! The OS of that server is Ubuntu 9 64bit.I have a glance at the path
Code:
/etc/rc2.d/
I only found some scripts which filename start by "S",but no one start with"K".Dose the system can also stop these services automatically?
The shutdown scripts should be in /etc/rc0.d. Have a look at https://help.ubuntu.com/community/UpstartHowto for an explanation of the process.
 
Old 05-25-2012, 04:09 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Towards the end of the shutdown process, after the K* shutdown scripts have been run, the shutdown procedure sends signal 15/SIGTERM to all remaining process then pauses (5 seconds on Slackware) then sends signal 9/SIGKILL to all remaining processes.

The design intention is that the services/daemons that do not have K* scripts are designed to be able to shut down quickly on receipt of SIGTERM, before the SIGKILL (which cannot be ignored) mops up any remaining processes.
 
1 members found this post helpful.
Old 05-25-2012, 04:12 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by cliffordw View Post
The shutdown scripts should be in /etc/rc0.d. Have a look at https://help.ubuntu.com/community/UpstartHowto for an explanation of the process.
That depends on the distro. Slackware, for example, does have a /etc/rc0.d directory but it is empty after a default installation.
 
Old 05-25-2012, 05:35 AM   #10
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Quote:
Originally Posted by catkin View Post
That depends on the distro. Slackware, for example, does have a /etc/rc0.d directory but it is empty after a default installation.
Yes, I agree, and said as much in post #3. The OP mentioned in post #4 that [s]he is running Ubuntu.
 
Old 05-25-2012, 05:50 AM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by cliffordw View Post
The OP mentioned in post #4 that [s]he is running Ubuntu.
Oops missed that. Sorry.
 
Old 05-25-2012, 06:45 AM   #12
vp0619520
Member
 
Registered: Jan 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
Thanks all.I have found some "K*"scripts in "/etc/rc0.d/".And I also restart the server with "shutdown" command.The server is running normally.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Remote Syslog Server Operation kaplan71 Linux - Software 16 08-17-2011 11:51 AM
Unable to shutdown/reboot server, no shutdown process running dctw Linux - Server 5 03-31-2010 05:46 AM
[SOLVED] How to keep operation running when server's program is closed eryn Linux - Networking 3 08-13-2009 09:37 PM
Secure Linux Distro Hardened for Server Operation colline Linux - Security 3 05-13-2005 07:04 PM
how can I remote shutdown other WinNT server from Linux Server? adelel Linux - Networking 2 01-06-2002 12:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration