LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] "NT Service" in Linux

[ILUG] "NT Service" in Linux

Vincent Cunniffe vcunniff at arbgroup.com
Fri Jan 21 11:41:47 GMT 2000


ilug-admin at linux.ie wrote:
> 
> Hi friends,
> 
> In NT we have a concept called, "Services",  which is basically
> an EXE file,  which will be automatically started by the OS , while
> booting,  and the Service will be stopped by the OS while shutting
> down ?
> 
> Can any body tell me,  Is this possible with Linux OS.  What is the
> Linux Concept ,  which is parallel to NT Serivces ?

Under Linux, there exists a set of plain text scripts, in a structured
directory tree.

The base directory is called (e.g. under RedHat)

	/etc/rc.d/rcN.d

where N is the 'runlevel' or current state of the machine. Level 3
is the standard runlevel, and thus /etc/rc.d/rc3.d/ is the standard
directory on boot into a textmode Linux system.

There are two types of files in the directory : ones beginning with
'S', and ones beginning with 'K'.

They are all of the form 'Knnsomename', where 'nn' is a number and 
'somename' is a descriptive but irrelevant title, such as nfsd, smbd, 
crond, etc.

On startup, all of the 'S' scripts are executed, one by one, in
numeric order. On shutdown, all of the K scripts are executed the 
same way. The scripts are passed a command line value of 'start'
during startup and 'stop' during shutdown.

These scripts can be either local scripts or links to a common 
script directory (/etc/rc3.d/init.d). Adding a service is as simple as
adding a new file of the correct format (Snnname) and it'll be run
automatically on startup. 

You can also run the scripts manually during runtime, using the same 
commandline values of 'start' and 'stop'. For most system default
scripts provided with distributions of Linux, you can also pass such
commands as 'restart' (combination of stop followed by start), 
'status' and so forth.

Running '/etc/rc.d/rc3.d/S91smbd restart', for example, will restart
the Samba service which is started by that script at runtime.

Regards,

Vin




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell