On Mon, Feb 28, 2000 at 07:39:29PM +1100, Roddy wrote:

> i would love to have this quick question answered. I'd like to have
> various programs start automatically after boot up. Now i've heard about
> the .xinitrc file, the only problem is that i don't know how to issue

.xinitrc is for starting programs when you start X, not when you boot your
machine.

To start something on boot depends to some extent on what it is, and
which init method your distribution uses.  I'll describe Redhat because a.
it's the distro I've used most, and b. it's what most people seem to have.
If you use something else, then some of this info won't be applicable to
you.

If there's a script in /etc/rc.d/init.d for the program you want to start,
for example sendmail, then you merely need to make sure there's a link
from /etc/rc.d/rc3.d/S80sendmail to /etc/rc.d/init.d/sendmail and it'll be
started automatically.  If you have a look in /etc/rc.d/rc3.d you'll see
something like this:

[johnc@dropbear /etc/rc.d]$ ls /etc/rc.d/rc3.d/
K00linuxconf   K30mcserv      K75gated       S30syslog      S85gpm
K05innd        K30sendmail    K85nfsfs       S40atd         S85httpd
K08autofs      K35dhcpd       K89portmap     S40crond       S85sound
K10xntpd       K45arpwatch    K92apmd        S50inet        S90vmware
K20bootparamd  K50snmpd       K96pcmcia      S55named       S90xfs
K20nfs         K55routed      S01kerneld     S60lpd         S91smb
K25squid       K60lpd         S10network     S75keytable    S99local
K28amd         K60mars-nwe    S20random      S80sendmail 

The files starting with 'S' are run when entering the run level to start
services, and those starting with 'K' are run to terminate services.  init
provides a single argument, `start' or `stop', when running these scripts.
If you do a long listing, you'll see that all these files are links to the
scripts in /etc/rc.d/init.d.  The numbers are important, they determine
the order in which the files are run.  You can find out what number to use
like this:

[johnc@dropbear ~]$ grep chkconfig /etc/rc.d/init.d/sendmail 
# chkconfig: 2345 80 30

The second number, 80, is the sequence number to be used to start
sendmail (the Snnxxx file).  The third number, 30, is the number to be
used when killing it (the Kmmxxx file).

To start it now, run the file with a single argument, `start'.  Next time
you boot, it'll start automatically.  For more information on how this all
works, see the man pages for `init' and `inittab'.


If you want to start something else, then there's a file called
/etc/rc.d/rc.local into which you can put anything you want.  It's just a
shell script, but make sure you put the full pathname of all programs in
there, and remember, it's run as root.


Cheers,

John
-- 
whois [EMAIL PROTECTED]
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to