Skip to Content.
Sympa Menu

sm-discuss - [SM-Discuss] new scheme for setting runlevels and init.d

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: nealbirch <nealbirch AT attbi.com>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: [SM-Discuss] new scheme for setting runlevels and init.d
  • Date: Sun, 22 Sep 2002 19:33:14 -0400

While typing away at the latest init.d spell, I wrote a couple of functions that would make it a lot easier to make sym link's to different run levels and I am slowly working my way through all the spells I have installed to implement it.

Since it only requires 4 commented lines (plus any additional comments) in any init script, and 2 functions to install the script file and create the links, it should not be to difficult to use.

This is what you will be seeing if you look at the new scripts:

#!/bin/bash
# /etc/init.d/networking.sh
# SGL-script-version=1
# this sets the run levels and priority for links
# SGL-START:3 4 5:S30
# SGL-STOP:0 1 2 6:K70

The script version let's the spell know when to update, SGL-[START,STOP] gives us a identifier, 2nd field is for runlevels and 3rd field is the priority to be assigned.

The installscript function uses the SGL-script-version to determine when to backup existing scripts and install updated ones. Each script will have a unique version number, incremented as changes are made.

The linkscript function checks the whether the links exist at the runlevels listed in the second field; if necessary it creates the link using the info the third field provides for priority.

Currently, the init.d spell installs the functions, mount.sh and networking.sh scripts and makes the necessary links. In addition, the networking.sh script is a very special case, and is handled a bit differently to setup.

Next 3 most likely to be included are modutils.sh, atd.sh and sysklogd.sh.

--
"You can fool some of the people all of the time
--and those are the ones you have to concentrate on!"
GW Bush-- from the N.Y. Times




  • [SM-Discuss] new scheme for setting runlevels and init.d, nealbirch, 09/22/2002

Archive powered by MHonArc 2.6.24.

Top of Page