Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tlug: Auto run at boot time



Darren Cook writes:
 > I've been reading how-to's and man pages, but I can't seem to find a simple
 > explanation of the following. I want to know where I put commands to run at
 > boot time. Here are the three types:
 > 
 > 1.A command to run once at boot-time, eg. to make a backup of all the files
 > in a directory.

Hmm ... /etc/rc.d/rc.local ? Or maybe ../rc.sysinit .

 > 2.Run apache (or some similar server) so it will be listening even if I
 > don't log in. I found the init.d directory, but I couldn't find where I
 > specify which daemons I want to be started. [*]

There are two main types of init configuration: the SysV type (used by 
most distributions, I think ... I know RedHat and TL use it) and the
BSD type. I'm only familiar with the former.

Anyway, if you have a SysV-type setup, you'll have /etc/rc.d/init.d,
and then some numbered directories -- /etc/rc.d/rc0.d,
/etc/rc.d/rc1.d, ... one for each runlevel. The contents of these
directories look like this:

K20rusersd
K20rwhod
K55routed
K95nfsfs
S01kerneld
S10network
S20random
S30syslog
S40atd
S40crond
S50inet
S60lpd
S60nfs
S75keytable
S80sendmail
S85gpm
S96canna
S99local

These are all symlinks to the init scripts in /etc/rc.d/init.d. The
'K' or 'S' prefix means 'kill' or 'start', and the number determines
the order to run the scripts in. 

[ Note that these scripts all control daemons; all the ones I know of
conform to a simple protocol using the commands 'start,' 'stop,'
'restart,' ... umm, and one or two others ... e.g., the command
'/etc/rc.d/init.d/sendmail restart' would do just what it looks like,
independently of the normal boot sequence. ]

Best of luck,

Matt Gushee
Oshamanbe, Hokkaido
-------------------------------------------------------------------
Next Technical Meeting: February 13 (Sat), 12:30 place: Temple Univ.
** presentation: XEmacs, by Steven Baur and Martin Buchholz
Next Nomikai: March 19 (Fri), 19:30   Tengu TokyoEkiMae 03-3275-3691
-------------------------------------------------------------------
more info: http://tlug.linux.or.jp                     Sponsor: PHT


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links