LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-12-2006, 02:19 PM   #1
naz37
LQ Newbie
 
Registered: Oct 2005
Location: Ireland
Posts: 11

Rep: Reputation: 0
init script not running


hello everyone. iv been trying to write a init script that will run at both boot and shutdown. the script is to creat a ramdisk and copy a load of files to it at boot time and copy the files back to the harddrive at shutdown. from what i can see the script itself is working, ie if i run it on the command line with start or stop args it does what its supose to. iv saved the file in "/etc/rc.d/init" and iv added a symbolic link to "/etc/rc.d/rc5.d" called "S99ramdiskCache.sh" to call the script at boot and another link in "/etc/rc.d/rc0.d" called "K00ramdiskCache.sh" to call it at shutdown. at boot the script is being called as it should, but at shutdown it isnt being called. i cant see what can be the problem. what i want is for it to be the first script called at shutdown hence the "K00" prefix. my distro is FC4 and im using the 2.6.16-1.2108_FC4 kernal.

if anyone has any ideas of where im going wrong or need more info please write back. any help will be greatly appreciated :-)
 
Old 06-12-2006, 02:39 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Does your script check if $1 is either "stop" "start",...?
 
Old 06-12-2006, 02:50 PM   #3
naz37
LQ Newbie
 
Registered: Oct 2005
Location: Ireland
Posts: 11

Original Poster
Rep: Reputation: 0
ye the script uses;
case "$1" in
start)
commands...
;;
stop)
commands...
;;
esac

the script works if i call it in the shell with "start" or "stop" as args. it just isnt being run when the system enters runlevel 0 during shutdown sequence.
 
  


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
Running SUSE 9.2 and have an issue with init 0 sternbj Linux - Newbie 3 01-13-2006 07:04 PM
/etc/init.d running at boot time chakkerz Linux - General 2 12-10-2005 04:15 AM
Init running before other initialisation? fatzo Linux - General 2 02-26-2004 06:51 AM
inetd script in /etc/init.d is running amuck int0x80 Linux - Newbie 1 03-07-2003 10:51 PM
could use some help with my init.d script.... BrianK Linux - General 3 10-31-2002 08:21 PM


All times are GMT -5. The time now is 09:00 PM.

Main Menu
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