| 
      
      
      From: <jam...@te...> - 2002-08-28 12:58:16
      
     | 
| > > 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).
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 (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.
Cheers...james
  - Jamie
 |