Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-02-2005, 02:23 PM   #1
LQ Newbie
Registered: Oct 2005
Location: India
Distribution: RedHat 7.3, Fedora 4
Posts: 19

Rep: Reputation: 0
How to register our own custom services to be initiated at known init level??

I need to create a system service whenever system starts it start by itself, without the need of anyone logging in.
Default initlevel is 5.
How to do it?? how to bring in perview of ntsysv menu??

Old 10-02-2005, 02:59 PM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
init scripts change a lot between different distro, so it depends on which one you are running, but there's certainly no concept of registering at all. what you'd do is firstly create your own init scrip tin /etc/rc.d/init.d (paths vary slightly of course..) which will respond to stop, start, restart args as normal ones do. that should be all you need ot have it listed in ntsysv or such like. normally you can just copy a simple script that already exists in there.
Old 10-02-2005, 08:21 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
If you look in the /etc/init.d directory, there will probably be a README file. There may also be a file named "skeleton". Take a look at those. There may also be some man-pages you can read through.

You may have the "chkconfig" program on your system. It can be used to install a service and determine the runlevels. This program examines and modifies a header in the program to determine which runlevels the program should run as.

For example, on my laptop, here is part of the beginning of /etc/init.d/pcmcia:
#! /bin/bash
# Copyright (c) 1996-2004 SuSE Linux AG, Germany.  All rights reserved.
# Author: Hubert Mantel <>, 1996
#         Christian Zoz <>, 2000
#         Joachim Gleissner <>, 2004
# /etc/init.d/pcmcia
# Provides:       pcmcia
# Required-Start: $local_fs
# X-UnitedLinux-Should-Start: coldplug
# Required-Stop:
# X-UnitedLinux-Should-Stop:
# Default-Start:  2 3 5
# Default-Stop:
# Description:    Loads pcmcia base modules and starts cardmgr
Not all systems use this style of starting services. Even if your distro does, you will want to read the documentation that comes with your system.

For example, there may be man-pages for "init", "chkconfig", and even for items such as "inittab" and "init.d". Consider printing out the man-pages.
I use the command "man -t <topic> | kghostview -" to read manpages. This produces a postscript version (much better looking). You could print it out the man-page from the ghostscript viewer program, or by issuing the command,
"man -t <topic> | lpr" which pipes the output to the printer.

Good Luck.

Last edited by jschiwal; 10-02-2005 at 08:22 PM.


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
changing init level h3htimo Linux - Newbie 5 10-24-2005 11:05 PM
Different Resolution init level 3 ? utw-mephisto Red Hat 4 06-19-2005 06:38 AM
rpc services current patch level amrogers3 Linux - Security 0 03-03-2005 09:53 AM
Register a custom protocol Bjorne Linux - Software 1 11-13-2004 08:25 AM
init level settings rufius Linux - General 1 04-29-2003 06:57 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration