From: Jamie C. <jca...@we...> - 2002-08-28 14:13:20
|
jam...@te... wrote .. > > > > This is one of those simple things that I rarely dig into though. > It > > > just works, so why bother understanding it? ;-) > > > > > > Anyway, in my RPMs I've gone under the assumption that you start it > in > > > runlevels where you want it to run and kill it in levels where you > don't > > > (thus network gets killed in level 1..actually everything gets killed > > > there except S00single). I may be wrong, but it seems to work. Then > > > again, so does Webmin! ;-) > > > > Looks like you are right .. all the other init scripts on my system have > > their S links in rc3.d, rc4.d and rc5.d , and their K links in rc0.d > , > rc1.d > > and rc6.d . So I'll make the Webmin RPM do the same thing .. > > You know it must have worked before because of the order in which the kill > scripts > are called. As in the /etc/rc.d/rc script you have the following comments: > > # First, run the KILL scripts. > . > . > . > # Now run the START scripts. > > So it was bascially killing webmin (though it was not there to be killed), > and then restarting it (or really starting it for the first time). Upon > shutdown webmin would be killed violently, but this may not have been a > problem and thus no one noticed. The one thing that would have occured > is > that > switching between run levels (say 3 to 5 for instance) would have webmin > stop and then restarted (which I do believe I have observed). Yeah, that's probably what happened. If I moved the K scripts to just runlevels 0, 1 and 6 would that cause it to attempt to be re-started when switching from runlevel 3 to 5 ? > Concerning chkconfig, I can see why for your purposes you may want to avoid > chkconfig. You want the RPM to install on as many machines as possible. > Still you probably don't want to have the links be part of the files that > ship > with the RPM. The reason is that those links are subject to change by > the > user (their kind of like config information). I would make their creatoin > part of your post script and their deletion part of your of your preun They could also be marked as config files in the .spec file I guess .. > (I > would > do this in the preun, because you need to be able to trace the links back > to the correct rc script...that is verify that they link to your webmin > rc script). Also, and you may not want to go this far, I would set the > post > script and pre-un script to use chkconfig if it exists. The reason I say > this is that, chkconfig on a RedHat derivative system (RedHat, Mandrake, > and friends) will handle the placement of these sym links automatically, > and > provide entries in some database (I am not sure where it lives) for ntsysv > and friends. Its just the right thing to do on a RedHat based system. > On the other hand that makes your code more complicated. I did consider having the script and links created by a post script, similar to code that is run when installing the .tar.gz version of webmin. This would be good for distros like suse that used /sbin as the init script base directory instead of /etc/init.d ! The only problem would be dealing with the situation in which users were upgrading from an old RPM that had the init scripts as part of the package. It should be possible to deal with though, so I will look into doing that in future .. - Jamie |