FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Debian > Debian dpkg

 
 
LinkBack Thread Tools
 
Old 05-07-2008, 10:03 PM
Joey Hess
 
Default Bug#471060: debhelper, start-stop-daemon -exec, and restarting daemons during upgrade

Guillem Jover wrote:
> Just to clarify, for upgrades the original file is not directly deleted,
> but in shell examples that's the closest we can do to test the
> behaviour. Something like this roughly simulates what dpkg would do:
>
> $ s-s-d start dictd
> $ cd /usr/sbin
> $ cp /bin/ls dictd.new
> $ ln dictd dictd.old
> $ mv dictd.new dictd
> $ rm dict.old
> $ s-s-d stop dictd
>
> and this should work on the shell and when done by dpkg.

If you actually try to make a package that uses -exec and restarts its
deamon in the postinst, it doesn't work. Example:

http://kitenet.net/~joey/tmp/dictd_1.10.11.dfsg-2_i386.deb

root@kodama:/home/joey/tmp>dpkg -i dictd_1.10.11.dfsg-2_i386.deb
Selecting previously deselected package dictd.
(Reading database ... 207015 files and directories currently installed.)
Unpacking dictd (from dictd_1.10.11.dfsg-2_i386.deb) ...
usermod: no changes
Setting up dictd (1.10.11.dfsg-2) ...
Starting dictionary server: dictd.
Processing triggers for man-db ...
root@kodama:/home/joey/tmp>ps ax |grep dictd
27024 ? Ss 0:00 dictd 1.10.11: 0/0
root@kodama:/home/joey/tmp>/etc/init.d/dictd restart
Restarting dictionary server: dictd.
root@kodama:/home/joey/tmp>ps ax |grep dictd
27046 ? Ss 0:00 dictd 1.10.11: 0/0
root@kodama:/home/joey/tmp>/var/lib/dpkg/info/dictd.postinst configure 1.10.11.dfsg-2
Restarting dictionary server: dictd.
root@kodama:/home/joey/tmp>ps ax |grep dictd
27131 ? Ss 0:00 dictd 1.10.11: 0/0

All good so far, but now try reinstalling:

root@kodama:/home/joey/tmp>dpkg -i dictd_1.10.11.dfsg-2_i386.deb
(Reading database ... 207054 files and directories currently installed.)
Preparing to replace dictd 1.10.11.dfsg-2 (using dictd_1.10.11.dfsg-2_i386.deb) ...
usermod: no changes
Unpacking replacement dictd ...
Setting up dictd (1.10.11.dfsg-2) ...
Restarting dictionary server: dictd.
Processing triggers for man-db ...
root@kodama:/home/joey/tmp>ps ax |grep dictd
27131 ? Ss 0:00 dictd 1.10.11: 0/0

pid did not change despite it "restarting" and now it's hosed:

root@kodama:/home/joey/tmp>/etc/init.d/dictd restart
Restarting dictionary server: dictd.
root@kodama:/home/joey/tmp>/etc/init.d/dictd stop
Stopping dictionary server: dictd (not running).
root@kodama:/home/joey/tmp>ps ax |grep dictd
27131 ? Ss 0:00 dictd 1.10.11: 0/0

The init script uses this to test if it's running, and after dpkg replaces
the binary it fails.

root@kodama:/home/joey/tmp>start-stop-daemon --start --quiet --pidfile /var/run/dictd.pid --exec /usr/sbin/dictd --test -v
Would start /usr/sbin/dictd .

--
see shy jo
 
Old 05-08-2008, 12:19 AM
Guillem Jover
 
Default Bug#471060: debhelper, start-stop-daemon -exec, and restarting daemons during upgrade

On Wed, 2008-05-07 at 17:03:37 -0400, Joey Hess wrote:
> If you actually try to make a package that uses -exec and restarts its
> deamon in the postinst, it doesn't work. Example:
>
> http://kitenet.net/~joey/tmp/dictd_1.10.11.dfsg-2_i386.deb

> All good so far, but now try reinstalling:

[...]

> The init script uses this to test if it's running, and after dpkg replaces
> the binary it fails.
>
> root@kodama:/home/joey/tmp>start-stop-daemon --start --quiet --pidfile /var/run/dictd.pid --exec /usr/sbin/dictd --test -v
> Would start /usr/sbin/dictd .

It fails because the preinst is unconditionally removing the pid file
on upgrade.

regards,
guillem


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 02:21 AM.

VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org