How to change strt-up sequence of services on SLES10/11


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to change strt-up sequence of services on SLES10/11
# 1  
Old 03-03-2010
MySQL How to change strt-up sequence of services on SLES10/11

Hi,

Can anyone tell me what the following 2 lines are doing

base=${0##*/}
link=${base#*[SK][0-9][0-9]}

I found this in a start up service script and I think it is giving the service link names which in turn will change the start up sequence of services.
# 2  
Old 03-03-2010
MySQL

Not a complicated one , this is a very simple bash stripping operations
Code:
base=${0##*/}
Normally $0 contains the name of the shell like bash or /bin/bash , this command
is used to strip the path if it is has. 
base contains bash ( for ex )

Code:
link=${base#*[SK][0-9][0-9]}
This is used to strip the given string upto the pattern [SK][0-9][0-9]
for ex: 
 base=k12bash

then  link contains bash only.

# 3  
Old 03-03-2010
The first line takes the positional parameter 0 (thats the name the script is invoked with) and strips from the left all characters up to and including the last slash. So it simply does what basename $0 would do.

The second line takes $base and strips from the left all characters up to and including the first character S or K and then two digits.

So, if the script is called as /etc/rc3.d/S79do_something, then base would be set to S79do_something and link would be set to do_something.
# 4  
Old 03-03-2010
Thanks for the explanations.

I am writing one start up script on SLES10 and am including the header
Code:
### BEGIN INIT INFO
# Provides: backserver
# Required-Start: clientserver
# Should-Start:
# Required-Stop:
# Default-Start: 2 3 4 5 6
# Default-Stop: 0 1 2 6
# Short-Description: backserver
# Description: Start backserver
### END INIT INFO
#!/bin/bash
#
# Startup script for backserver
#
#
# description: backserver
# Source function library.
. /etc/rc.status
rc_reset

This backserver service along with clientserver service should start after system reboot.
But everytime I reboot the system backserver is not starting since clientserver has not yet started.

Since the links generated in/etc/init.d/rc5.d as
S01backserver
S01clientserver
and they are trying to get started in alphabetical order.
I want a way by which I can change the SXX values of the links.

Last edited by pludi; 03-03-2010 at 04:13 AM.. Reason: code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to Start services based on dependent services on other AIX machine

Hi, I just started working on a script. After my research, i found a command which can help me: AIM: To build a script which starts the services (Services 1) on server 1 automatically whenever its down. And it has a dependency on other service (Service 2) on Server 2. So my script has to... (4 Replies)
Discussion started by: draghun9
4 Replies

2. Red Hat

Restart of services if port no is changed in /etc/services in RHEL

I had a doubt if any services need to be restarted if port no in /etc/services in an RHEL setup is changed. For eg, the port no of 443 for SSL may need to be changed. I hope my query is clear whether any services need to be restarted if port no in /etc/services is changed. Please revert with... (10 Replies)
Discussion started by: RHCE
10 Replies

3. UNIX for Dummies Questions & Answers

Change sequence names in fasta file

I have fasta files with multiple sequences in each. I need to change the sequence name headers from: >accD:_59176-60699 ATGGAAAAGTGGAGGATTTATTCGTTTCAGAAGGAGTTCGAACGCA >atpA_(reverse_strand):_showing_revcomp_of_10525-12048 ATGGTAACCATTCAAGCCGACGAAATTAGTAATCTTATCCGGGAAC... (2 Replies)
Discussion started by: tyrianthinae
2 Replies

4. Shell Programming and Scripting

find common entries and match the number with long sequence and cut that sequence in output

Hi all, I have a file like this ID 3BP5L_HUMAN Reviewed; 393 AA. AC Q7L8J4; Q96FI5; Q9BQH8; Q9C0E3; DT 05-FEB-2008, integrated into UniProtKB/Swiss-Prot. DT 05-JUL-2004, sequence version 1. DT 05-SEP-2012, entry version 71. FT COILED 59 140 ... (1 Reply)
Discussion started by: manigrover
1 Replies

5. UNIX for Dummies Questions & Answers

How to change sequence name in along fasta file?

Hi I have an alignment file (.fasta) with ~80 sequences. They look like this- >JV101.contig00066(+):25302-42404|sequence_index=0|block_index=4|species=JV101|JV101_4_0 GAGGTTAATTATCGATAACGTTTAATTAAAGTGTTTAGGTGTCATAATTT TAAATGACGATTTCTCATTACCATACACCTAAATTATCATCAATCTGAAT... (2 Replies)
Discussion started by: baika
2 Replies

6. UNIX for Advanced & Expert Users

SLES10 is showing the machine name intead of the owner's username

Hi, I'm the administrator of a server with SLES10 and when I type "ls -l" I'm getting a machine name where I should be getting the username, for example: server:~# ls -l drwxrwx---+ 3 user-1152$ group1 4096 2009-11-25 12:56 folder drwxrwx---+ 3 user-1113$ group2 4096 2010-03-10 15:34... (4 Replies)
Discussion started by: rodrigoroma
4 Replies

7. Shell Programming and Scripting

How to change strt-up sequence of services on SLES10/11

Hi All, I want to change the start-up sequence of services on SLES10/11. I have my own start-up scripts for some services and I want them to start in a particular order(not in alphabetical order) Can anyone help me on this issue? (4 Replies)
Discussion started by: senrooy
4 Replies

8. Red Hat

change the shutdown sequence in red hat linux

Hi, I use red hat linux kernel 2.6 I want to add the application shutdown in shutdown sequence . I add the K script in /etc/rc.d/ all sub directory for all running level . But the auto shutdown application is not appear when I type "shutdown -r now" .. There is no indication the application... (5 Replies)
Discussion started by: chuikingman
5 Replies

9. SuSE

SLES10 - cronjob issue?

I installed some software (zenworks linux management) and it apparently set up a cronjob for a postgresql database command. The job runs every 4 hours and fails everytime sending root mail... the problem I have is I cant find this job anywhere. ive looked in all the usual cronjob places but... (1 Reply)
Discussion started by: trey85stang
1 Replies

10. Solaris

how to change the boot sequence?

Hi all, I have solaris and xp installed... Usually solaris occupies the first boot slot. So i wanted to know if it is possible to change the boot sequence to xp first and then solaris? (5 Replies)
Discussion started by: wrapster
5 Replies
Login or Register to Ask a Question