rc.d script to stop not workign

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users rc.d script to stop not workign
# 1  
Old 08-27-2011
rc.d script to stop not workign

I have a simple script that I have put in all the rc.d directories from 1-6 and have named it K20blah and S20blah .I am on red hat linux and I see that when i do reboot the S20blah is ignored but the K20blah is executed during startup . Any suggestions?

#! /bin/sh
# /etc/init.d/blah

# Some things that run always
touch /var/lock/blah

# Carry out specific functions when asked to by the system
case "$1" in
    echo "Starting script blah " >start.out
    echo "Could do more here"
    echo "Stopping script blah">stop.out
    echo "Could do more here"
    echo "Usage: /etc/init.d/blah {start|stop}"
    exit 1

exit 0

# 2  
Old 08-27-2011
One query:
Do you say that "K" script is getting called while system start up?

Two things:
1. When you do reboot your "K" scripts won't be called, it is not graceful shutdown of system. Please check for difference between "reboot" and "init 6", it would help.
2. Proper way is to put script in /etc/init.d, and making symbolic links for rc*.d directories to /etc/init.d with proper "S" and "K" notation.
# 3  
Old 08-28-2011
The script below is actually in /etc/init.d and there are symlinks to /etc/rc.xd directories and I have put the links in all the rc directories.

The problem I am having is the K script is not working when it is rebooted but the S script indeed works when the systems come up .

I want to know what if anything I am doing wrong here . I need the K script to run so we can gracefully shutdown .
# 4  
Old 08-29-2011
There is no different "K" script, can you please try to reboot system using "init 6" and check if "K" script ran or not ?
When you do reboot your "K" scripts won't be called, it is not graceful shutdown of system. Please check for difference between "reboot" and "init 6", it would help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Stop child script by stoping parent script

Hi everyone, I have this problem with a script I'm writting. I want to execute a code running in the background several times through a script. I am writting it like that parent_script for a in 1 2 3 4 5 do exec test -n $a done What I want to do is when parent_script is killed,... (0 Replies)
Discussion started by: geovas
0 Replies

2. UNIX for Dummies Questions & Answers

Need help making a start/stop script...

i have two separate scripts that work nicely to curl and generate two files.. one html and one txt so a total of four. When the script starts up i want it to: call and run shellscripta call and run shellscriptb sleep for about 40 seconds again run shellscripta again run shellscriptb check... (4 Replies)
Discussion started by: phpfreak
4 Replies

3. Shell Programming and Scripting

How to stop a script running in remote server from local script

Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Discussion started by: mannepalli
1 Replies

4. Shell Programming and Scripting

script don't stop

Hello everybody! I am new to this and I am trying to change a script in an open source program that plots some offset vectors and then calls a postscript viewer. I have commented away the call for the postscript viewer but somehow the script doesn't return to the shell prompt. I cant figure out... (3 Replies)
Discussion started by: larne
3 Replies

5. UNIX for Dummies Questions & Answers

Stop a shell script

Hi, I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following: mike=1 if ; then STOP THE SCRIPT fi (3 Replies)
Discussion started by: msb65
3 Replies

6. Shell Programming and Scripting

Script to run non-stop

Hi All, I am on a Solaris OS and i have come up with a csh script named " mycshscript " which will grab data from a datalog file & format the grabbed data & upload formated version to web server. I would want to have this script to run non-stop so that the latest can be captured since data is... (37 Replies)
Discussion started by: Raynon
37 Replies

7. UNIX for Dummies Questions & Answers

Script that doesn't stop

Hi all, I got a script that runs automatically using the cron file. The script starts running at midnight and suppose to delete image files from folders and sub-folders. The script ends when he finishes deleting or after 5 hours. My problem is that the script doesn't stop running even after 5... (3 Replies)
Discussion started by: biot
3 Replies

8. Shell Programming and Scripting

Script does not stop when doing a read

Hi Folks, I have been trying to create a script wherein after it reads a certain number of data, it will pause and ask the user if he wants to continue or not. However, it seems that when it is supposed to read the user's answer, the script will go into a loop. What is wrong with my script here?... (7 Replies)
Discussion started by: rooseter
7 Replies

9. UNIX for Advanced & Expert Users

how to stop others users to stop viewing what i am doing ?

Hi , I have one question, suppose i am a normal user and when i use 'w' command , it shows who is logged on and what they are doing . Now i want to stop others users to know what i am doing accept the root ? can i do this ? thanks (5 Replies)
Discussion started by: mobile01
5 Replies

10. UNIX for Dummies Questions & Answers

Start/Stop Script

I'm a newbie to the Unix world Help! I have to maintain a host of Sybase database servers sitting on Unix Sun Solaris 8...I've been tasked with finding/creating a way to auto start/stop Unix via unix commands, specifically when the Unix servers need to be restarted we want Sybase to start... (2 Replies)
Discussion started by: jjv1
2 Replies
Login or Register to Ask a Question