spousteni programu
Petr Novotny
Petr.Novotny na antek.cz
Středa Prosinec 1 15:57:46 CET 1999
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 1 Dec 99, at 15:48, Novotny Petr wrote:
> muze mi nekdo dat to spravne know-how jak funguje spousteni programu
> pomoci /etc/rc.d , nainstaloval jsem squida , a rucne ho nahodim pomoci
> /etc/rc.d/init.d/squid start . myslel jsem ze pokud dany sw ma spousteci
> prog v danem adresari /etc/rc.d/init.d tak nabehne automaticky a ono ne .
Viz /etc/rc.d/rc: (citat)
# Is there an rc directory for this new runlevel?
if [ -d /etc/rc.d/rc$runlevel.d ]; then
# First, run the KILL scripts.
for i in /etc/rc.d/rc$runlevel.d/K*; do
# Check if the script is there.
[ ! -f $i ] && continue
# Check if the subsystem is already up.
subsys=${i#/etc/rc.d/rc$runlevel.d/K??}
[ ! -f /var/lock/subsys/$subsys ] && \
[ ! -f /var/lock/subsys/${subsys}.init ] && continue
# Bring the subsystem down.
$i stop
done
# Now run the START scripts.
for i in /etc/rc.d/rc$runlevel.d/S*; do
# Check if the script is there.
[ ! -f $i ] && continue
# Check if the subsystem is already up.
subsys=${i#/etc/rc.d/rc$runlevel.d/S??}
[ -f /var/lock/subsys/$subsys ] || \
[ -f /var/lock/subsys/${subsys}.init ] && continue
# Bring the subsystem up.
$i start
done
fi
Jinymi slovy: Pri prechodu na runlevel X to v adresari /etc/rc.d/rcX.d
spusti vsechny soubory K* s parametrem "stop" (typicky linky do
/etc/rc.d/init.d) a pak vsechny soubory S* s parametrem "start".
(Cisla runlevels:
0 - halt
1 - single
2 - nepouzivan; mel by byt plny bez NFS
3 - bezny provoz
4 - nepouzivan
5 - bezny s xdm ("boot do X")
6 - reboot)
squid vam tedy nevytvoril linky v /etc/rc.d/rc?.d
Vytvorit je lze
a. manualne
b. programem chkconfig (console-based)
c. programem tusim tksysv (X-based)
b a c vyzaduje specialni format hlavicky souboru v /etc/rc.d/init.d -
kdyztak nacerpejte inspiraci v nejakem funckcnim.
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.0.2 -- QDPGP 2.60
Comment: http://community.wow.net/grt/qdpgp.html
iQA/AwUBOEVFiFMwP8g7qbw/EQJqlACfbVno/eIFoLMclZqsk3ZSASpA6R4An0ks
oGzCEvHrqfnI47LGXgkVs+xe
=Zvel
-----END PGP SIGNATURE-----
--
Petr Novotny, ANTEK CS
Petr.Novotny na antek.cz
http://www.antek.cz
PGP key ID: 0x3BA9BC3F
-- Don't you know there ain't no devil there's just God when he's drunk.
[Tom Waits]
Další informace o konferenci Linux