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

Re: dhcpcd procedure

On Fri, Oct 01, 1999 at 12:28:36PM -0400, Dpk wrote:
> I recently adopted dhcpcd... previous versions of dhcpcd would restart
> during upgrades, which obviously is bad for those doing it remotely.
> Since my recent upload does not restart dhcpcd, I need to start it for
> those upgrading from previous versions that did stop the daemon.  
> What would be the best way to check for this?  A simple 'ps |grep
> dhcpcd' ? Would doing so make my package dependent on procps?

Maybe you could use the "pidof" utility, which comes with sysvinit
(which is "Essential: yes" package)?

> is there a convenient way to check the installed version of dhcpcd
> someway?

>From the packaging manual:

     3.   1.   If the package is being upgraded, call:
                    <new-preinst> upgrade <old-version>

     When we configure a package (this happens with `dpkg --install', or
     with `--configure'), we first update the conffiles and then call:
          <postinst> configure <most-recently-configured-version>

So, you could put something like this in the preinst:

if [ "$1" = "upgrade" -a "$2" ]; then
  <whatever you need to do>

Or this in postinst:

if [ "$1" = "configure" -a "$2" ]; then
  <whatever you need to do>

And yes, this question would be more appropriate for debian-mentors

enJoy -*/\*- don't even try to pronounce my first name

Reply to: