LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-01-2010, 07:21 AM   #1
izghitu
Member
 
Registered: Oct 2005
Location: localhost.localdomain
Distribution: CentOS
Posts: 109

Rep: Reputation: 16
start up script(part 2)


Hi,

I added a script to /etc/init.d/local and made it run at boot using:
Code:
update-rc.d local defaults 80
Is there any way for me to make it NOT run when the server is rebooted/halted?

Please advise.
 
Old 01-02-2010, 05:32 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
The classic way to handle this is to add a case statement, since these
scripts are called with a parameter such as start and stop.

case "$1" in
start)
echo Starting $0...
;;
stop)
echo "Doing nothing" > /dev/null
;;
*)
echo "Only start and stop options are supported for $0" >&2
;;
esac
 
1 members found this post helpful.
  


Reply



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
start script bash when system start,stop,reeboot, how ?? melmar Linux - General 4 12-10-2009 06:58 AM
Need help with script to organise files into folders as part of DVD backup script jasybee2000 Linux - Newbie 5 06-15-2009 07:29 PM
script to get a part of line from a file mystical dervish Programming 7 05-11-2007 02:57 AM
LXer: Kick-Start your Java Apps, Part 2 LXer Syndicated Linux News 0 11-25-2006 07:21 PM
script part 2 ceph Linux - General 2 11-20-2005 01:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 10:17 PM.

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