LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 03-29-2013, 06:21 PM   #1
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,974

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
rc.6 and rc.local_shutdown


Hi,

I'm installing postgresql from slackbuilds.org.

The README-file says that one should put the following lines into /etc/rc.local_shutdown
Code:
# Stop postgres
	if [ -x /etc/rc.d/rc.postgresql ]; then
		/etc/rc.d/rc.postgresql stop
	fi
Since we don't have this file /etc/rc.d/rc.local_shutdown in Slackware I examinded the /etc/rc.d/rc.6 file in order to find out if I could put the code which stops the database there. I found the following lines in /etc/rc.d/rc.local_shutdown
Code:
# Run any local shutdown scripts:
if [ -x /etc/rc.d/rc.local_shutdown ]; then
  /etc/rc.d/rc.local_shutdown stop
fi
This seems odd to me. I think that the script rc.local_shutdown should be called without a parameter (without stop), like rc.local?

I suppose that "stop" doesn't do anything, but probably it should be removed.

I've now created a rc.local_shutdown and removed the stop from rc.6

Markus

Last edited by markush; 03-29-2013 at 06:24 PM.
 
Old 03-29-2013, 06:26 PM   #2
GazL
Senior Member
 
Registered: May 2008
Posts: 3,503

Rep: Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025
Quote:
Originally Posted by markush View Post
Hi,

I'm installing postgresql from slackbuilds.org.
I'd wait a few days:
http://lwn.net/Articles/545172/


If nothing makes reference to $1 in the shutdown script then it's not doing any harm, but yes, passing 'stop' to a shutdown script does seem a little redundant.
 
1 members found this post helpful.
Old 03-29-2013, 06:32 PM   #3
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,974

Original Poster
Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Thanks for the quick reply,
Quote:
Originally Posted by GazL View Post
I'd wait a few days:
http://lwn.net/Articles/545172/
...
I've read this on Twitter, but I'll use the database only at home for learning.
Quote:
...
If nothing makes reference to $1 in the shutdown script then it's not doing any harm, but yes, passing 'stop' to a shutdown script does seem a little redundant.
Yes, it doesn't any harm, but I wanted to verify that I make no mistake when I delete "stop".

Markus
 
Old 03-29-2013, 06:42 PM   #4
GazL
Senior Member
 
Registered: May 2008
Posts: 3,503

Rep: Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025
I suspect the only reason the 'stop' is there is because that section of code was a cut/paste from one of the ones above it. I wouldn't worry.
 
Old 03-29-2013, 06:50 PM   #5
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 876

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
It calls it with $1 == stop because

1) it doesn't hurt
2) if you only have one shutdown script that you're calling, you could actually make a symlink rc.local_shutdown -> rc.postgresql and be good to go.
 
3 members found this post helpful.
Old 03-29-2013, 06:58 PM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,974

Original Poster
Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Quote:
Originally Posted by volkerdi View Post
It calls it with $1 == stop because

1) it doesn't hurt
2) if you only have one shutdown script that you're calling, you could actually make a symlink rc.local_shutdown -> rc.postgresql and be good to go.
Thanks Pat, I'll create a symlink.

I missed the point that the "stop" works on a symlink like
Code:
/etc/rc.d/rc.postgresql stop
Markus
 
Old 03-29-2013, 07:12 PM   #7
GazL
Senior Member
 
Registered: May 2008
Posts: 3,503

Rep: Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025Reputation: 1025
Quote:
Originally Posted by volkerdi View Post
It calls it with $1 == stop because

2) if you only have one shutdown script that you're calling, you could actually make a symlink rc.local_shutdown -> rc.postgresql and be good to go.
Sneaky. I would have never thought of that.
I like it.
 
  


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
'Housekeeping' with /etc/rc.d/rc.local_shutdown? andrew.46 Slackware 3 08-05-2008 08:59 PM


All times are GMT -5. The time now is 09:00 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration