Bug#414929: could you try this patch

2007-03-22 Thread Henrique de Moraes Holschuh
On Wed, 21 Mar 2007, Steve Langasek wrote:
 That's not what --oknodo means. Please see the manpage; --oknodo is exactly
 what's wanted here.

Was start-stop-daemon fixed, then?  In the past --oknodo behaved
differently, which is the reason for the ammount of code in amavisd-new to
make sure not running can be told apart from failed to stop...

  In fact, that's how I'd fix this bug if I had the time right now.
 
 Does this mean you don't have time (even with a patch), and would like an
 NMU?

NMUs are usually welcome when I don't respond promptly.  In fact, timidity
has been NMUed already...

I won't object to NMUs (0-day or delayed) to fix timidity. As long as
they're done properly, with a NMU patch sent to the BTS, etc, they're
welcome.

-- 
  One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie. -- The Silicon Valley Tarot
  Henrique Holschuh


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Processed: Re: Bug#414929: could you try this patch

2007-03-22 Thread Debian Bug Tracking System
Processing commands for [EMAIL PROTECTED]:

 tags 414929 patch
Bug#414929: timidity can't be removed/purged/upgraded
Tags were: confirmed
Tags added: patch

 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#414929: could you try this patch

2007-03-22 Thread Eddy Petrișor
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

tags 414929 patch
thanks


Steve Langasek wrote:
 On Wed, Mar 21, 2007 at 11:10:48PM -0300, Henrique de Moraes Holschuh wrote:
 On Thu, 22 Mar 2007, Eddy Petri??or wrote:
 Just a tired and blind attempt at this bug.
 Could you patch the init script with the attached pacth and see if
 it works?
 
 --oknodo in stop is never acceptable, it is NOT OK if the daemon is there
 and we don't stop it.  Thanks for the effort, anyway.
 
 That's not what --oknodo means. Please see the manpage; --oknodo is exactly
 what's wanted here.

Just to spare people from going to the manual:

If such a  process does  not exist, start-stop-daemon exits with
error status 1 (0 if --oknodo is specified)

 
 The only part of this patch that doesn't make sense is passing an explicit
 --signal option, when it's the same as the default behavior.

Yes, I should never send patches when I am tired :-) I was trying
something along the lines of the code below.

- -   if start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
- -  --exec ${DAEMON} --retry 10 ; then
+   if start-stop-daemon --stop --quiet --oknodo --pidfile
${PIDFILE} \
+  --signal TERM/3/TERM/3/KILL/10; then


Still I wasn't sure if it would make any difference to try to TERM
twice and I ended up in sending a half baked/broken patch.

Maybe is time to install timidity and check if I can reproduce the
bug :-)

(after some time)

So I went on and changed the command, and came up with a patch.

I could reproduce the bug on my machine after uncommenting the
option in /etc/default, and, of course the result was fine after
applying the patch...

 In fact, that's how I'd fix this bug if I had the time right now.
 
 Does this mean you don't have time (even with a patch), and would like an
 NMU?

NMU patch attached.


Below this line is not that relevant for this bug...
- --

OTOH, Steve, you said that the --exec option should not be used, but
I see the same type of code for many other daemons on my system, so
the issue you are talking about should happen for these binaries,
too, shouldn't it?

Or am I missing something like most or all are calling that in a
fuinction?

(Went and tested a little)

I tested on laptop-net's init script (well, its stop command) which
also uses --exec and it seems the --exec parameter should be indeed
avoided for --stop:

bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian# cp
/usr/lib/laptop-net/ifd{,.a}
bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian# rm
/usr/lib/laptop-net/ifd
rm: remove regular file `/usr/lib/laptop-net/ifd'? y
bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian# ll
/proc/`cat /var/run/ifd.pid`/exe
lrwxrwxrwx 1 root root 0 2007-03-23 00:11 /proc/6401/exe -
/usr/lib/laptop-net/ifd (deleted)
bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian#
start-stop-daemon --stop --oknodo --pidfile /var/run/ifd.pid --exec
/usr/lib/laptop-net/ifd ; echo $?
start-stop-daemon: stat /usr/lib/laptop-net/ifd: No such file or
directory (No such file or directory)
2
bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian# cp
/usr/lib/laptop-net/ifd{.a,}
bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian# ps ax |
grep ifd
 6401 ?Ss 0:00 /usr/lib/laptop-net/ifd
/usr/share/laptop-net/link-change eth0
 6710 pts/5R+ 0:00 grep ifd
bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian# ll
/proc/`cat /var/run/ifd.pid`/exe lrwxrwxrwx 1 root root 0 2007-03-23
00:11 /proc/6401/exe - /usr/lib/laptop-net/ifd (deleted)
bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian#
start-stop-daemon --stop --oknodo --pidfile /var/run/ifd.pid ; echo $?
0
bounty:/home/eddy/usr/src/timidity/timidity-2.13.2/debian# ps ax |
grep ifd  6729 pts/5S+ 0:00 grep ifd

- --
Regards,
EddyP
=
Imagination is more important than knowledge A.Einstein
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGAwmfY8Chqv3NRNoRAntHAKDPSYL/Lue1OKZ6w5/6DRX1LOtaeQCfZaJV
R5HYPxILh2n6tWwMRK6e4qE=
=vfte
-END PGP SIGNATURE-
diff -ruN timidity-2.13.2.old/debian/changelog timidity-2.13.2/debian/changelog
--- timidity-2.13.2.old/debian/changelog	2007-03-23 00:45:23.0 +0200
+++ timidity-2.13.2/debian/changelog	2007-03-23 00:44:17.0 +0200
@@ -1,3 +1,12 @@
+timidity (2.13.2-7.3) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * urgency high since it fixes an RC bug
+  * do not fail if the daemon is not started and stop is attempted
+(Closes: #414929)
+
+ -- Eddy Petrișor [EMAIL PROTECTED]  Fri, 23 Mar 2007 00:42:59 +0200
+
 timidity (2.13.2-7.2) unstable; urgency=low
 
   * Non-maintainer upload with maintainer permission.
diff -ruN timidity-2.13.2.old/debian/timidity.init timidity-2.13.2/debian/timidity.init
--- timidity-2.13.2.old/debian/timidity.init	2007-03-23 00:45:23.0 +0200
+++ timidity-2.13.2/debian/timidity.init	2007-03-23 

Bug#414929: could you try this patch

2007-03-22 Thread Steve Langasek
On Thu, Mar 22, 2007 at 08:56:28AM -0300, Henrique de Moraes Holschuh wrote:
 On Wed, 21 Mar 2007, Steve Langasek wrote:
  That's not what --oknodo means. Please see the manpage; --oknodo is exactly
  what's wanted here.

 Was start-stop-daemon fixed, then?  In the past --oknodo behaved
 differently, which is the reason for the ammount of code in amavisd-new to
 make sure not running can be told apart from failed to stop...

Sorry, I'm not aware that --oknodo ever behaved differently; this has been
the documented behavior as far as I remember.

But it's certainly possible to get a false negative if using --exec with
--stop, as I mentioned, because s-s-d will simply fail to recognize that a
running process is one that should be stopped.  So maybe that's the problem
you're thinking of?

  Does this mean you don't have time (even with a patch), and would like an
  NMU?

 NMUs are usually welcome when I don't respond promptly.  In fact, timidity
 has been NMUed already...

 I won't object to NMUs (0-day or delayed) to fix timidity. As long as
 they're done properly, with a NMU patch sent to the BTS, etc, they're
 welcome.

Ok, please find attached the diff for an NMU that I'll be uploading shortly.

On Fri, Mar 23, 2007 at 12:56:31AM +0200, Eddy Petrișor wrote:
 Yes, I should never send patches when I am tired :-) I was trying
 something along the lines of the code below.

 - -   if start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
 - -  --exec ${DAEMON} --retry 10 ; then
 +   if start-stop-daemon --stop --quiet --oknodo --pidfile
 ${PIDFILE} \
 +  --signal TERM/3/TERM/3/KILL/10; then

 Still I wasn't sure if it would make any difference to try to TERM
 twice and I ended up in sending a half baked/broken patch.

Surely not relevant to the problem at hand; I wouldn't mess with the kill
signals unless there's a concrete problem with stopping processes once
they've been identified.

 OTOH, Steve, you said that the --exec option should not be used, but
 I see the same type of code for many other daemons on my system, so
 the issue you are talking about should happen for these binaries,
 too, shouldn't it?

Yes.  And it does, and it's a problem. :)

Cheers,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/
diff -u timidity-2.13.2/debian/changelog timidity-2.13.2/debian/changelog
--- timidity-2.13.2/debian/changelog
+++ timidity-2.13.2/debian/changelog
@@ -1,3 +1,16 @@
+timidity (2.13.2-7.3) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High-urgency upload for RC bugfix.
+  * Call start-stop-daemon with --oknodo when stopping timidity in the
+init script, so that a stopped daemon isn't treated as an error on
+upgrade.  Closes: #414929.
+  * Also, don't use --exec with start-stop-daemon --stop, as this will
+fail to find a running daemon if the on-disk binary has been moved
+out from under us for any reason; use --name instead.
+
+ -- Steve Langasek [EMAIL PROTECTED]  Thu, 22 Mar 2007 16:05:48 -0700
+
 timidity (2.13.2-7.2) unstable; urgency=low
 
   * Non-maintainer upload with maintainer permission.
diff -u timidity-2.13.2/debian/timidity.init timidity-2.13.2/debian/timidity.init
--- timidity-2.13.2/debian/timidity.init
+++ timidity-2.13.2/debian/timidity.init
@@ -52,8 +52,8 @@
 	;;
   stop)
   	echo -n Stopping $DESC: 
-	if start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
-	   --exec ${DAEMON} --retry 10 ; then
+	if start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE} \
+	   --name $(basename ${DAEMON}) --retry 10 ; then
 		echo timidity.
 	else
 		echo (failed).


Bug#414929: could you try this patch

2007-03-21 Thread Eddy Petrișor
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

Just a tired and blind attempt at this bug.
Could you patch the init script with the attached pacth and see if
it works?

- --
Regards,
EddyP
=
Imagination is more important than knowledge A.Einstein
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGAcoXY8Chqv3NRNoRAs+SAJ9wqQGFgeDIRAkoY+IaVOWLekbRIACfSsmh
0zHHZ8To8lGKtlbX+VEKE0A=
=1mAQ
-END PGP SIGNATURE-
--- timidity.init.old	2007-03-22 01:54:18.0 +0200
+++ timidity.init	2007-03-22 02:09:33.0 +0200
@@ -52,8 +52,8 @@
 	;;
   stop)
   	echo -n Stopping $DESC: 
-	if start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
-	   --exec ${DAEMON} --retry 10 ; then
+	if start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE} \
+	   --exec ${DAEMON} --signal TERM --retry 10; then
 		echo timidity.
 	else
 		echo (failed).


Bug#414929: could you try this patch

2007-03-21 Thread Henrique de Moraes Holschuh
On Thu, 22 Mar 2007, Eddy Petri??or wrote:
 Just a tired and blind attempt at this bug.
 Could you patch the init script with the attached pacth and see if
 it works?

--oknodo in stop is never acceptable, it is NOT OK if the daemon is there
and we don't stop it.  Thanks for the effort, anyway.

If you do have the time, package amavisd-new has a good initscript that does
things right.  One could probably easily make a patch using the same logic
for start and stop for timidity.

In fact, that's how I'd fix this bug if I had the time right now.

-- 
  One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie. -- The Silicon Valley Tarot
  Henrique Holschuh


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#414929: could you try this patch

2007-03-21 Thread Steve Langasek
On Wed, Mar 21, 2007 at 11:10:48PM -0300, Henrique de Moraes Holschuh wrote:
 On Thu, 22 Mar 2007, Eddy Petri??or wrote:
  Just a tired and blind attempt at this bug.
  Could you patch the init script with the attached pacth and see if
  it works?

 --oknodo in stop is never acceptable, it is NOT OK if the daemon is there
 and we don't stop it.  Thanks for the effort, anyway.

That's not what --oknodo means. Please see the manpage; --oknodo is exactly
what's wanted here.

The only part of this patch that doesn't make sense is passing an explicit
--signal option, when it's the same as the default behavior.

 In fact, that's how I'd fix this bug if I had the time right now.

Does this mean you don't have time (even with a patch), and would like an
NMU?

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]