LinuxQuestions.org
Register a domain and help support LQ
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 12-27-2007, 04:48 PM   #1
trapix22
LQ Newbie
 
Registered: Apr 2007
Posts: 17

Rep: Reputation: 0
Need help adding a script to shutdown sequence


(Debian - Etch - KDE)
I've installed "secure-delete" and it comes with a script with instructions which say: "You should run this in the STOP runlevels 2 and 3". It's supposed to wipe RAM (smem), swap (sswap) and fill sector empty space (sfill) sometime during the shutdown process to clean out the system every time it shuts down.

Also, instead of running the entire script, each program can be run on its own (i.e "smem") in which case the instruction is: "Just put this in the late run level of the STOP part of rc2.d".

I know "S" is for "start" and "K" is for "stop" and I'm supposed to put the script itself in the /etc/init.d, then "symlink" it in /rcX.d. I've put these scripts in so many places and run so many commands that now I get blank screens and crashes and I have no clue what I've done.

Would someone be so kind and write step by step how to add a "myscipt.sh" to the LATE part of the shutdown sequence. What does "late run level" mean (K92 is later than K20... correct?) and what is the "stop" part? I've read codes and seen lines like "...start)" and "...stop)"... Do I add it in that section?...Thank you so much.
 
Old 12-29-2007, 02:08 AM   #2
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,442

Rep: Reputation: 71
Yes K92 would be later than K20 (K99 would be the last script to be executed) and K is for 'Kill'.

If I remember correctly with Sys V style scripts on Debian-based systems you are supposed to use update-rc.d to manage your startup scripts. But yes, the basic idea is that the script will go under /etc/init.d and you will have symlinks pointing to it from directories (/etc/rc?.d) corresponding to the runlevels you are interested in using the script.

It might be helpful if you post what you currently have in /etc/rc?.d and /etc/init.d. Do a ls -l so we can see where the symlinks point to.

The actual script should have stop and start sections and these are called as needed. You don't need to write these.

This page about debian runlevels may be helpful to you.

Sorry this isn't a step by step how to, but I don't know the current state you are in and I am not currently using sys V style scripts (I use BSD style - much simpler in my opinion).
 
  


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
Shell script adding autostart gnome script Coolrunr Programming 3 01-01-2009 03:23 PM
FC5 shutdown sequence blank screen General Fedora 4 04-23-2006 01:44 PM
Adding shutdown option to gnome eranj Linux - Software 3 07-19-2005 11:20 AM
Help to remove script from booting sequence sasha_baranov Linux - Newbie 1 11-18-2004 10:34 AM
Knoppiz, Why go through shutdown sequence? jlturbos Linux - Distributions 3 02-09-2004 10:06 PM


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