Bug#625815: ikiwiki-hosting-web: cronjob exits with error after package removal

2011-05-07 Thread Holger Levsen
Hi Lars,

On Samstag, 7. Mai 2011, Lars Wirzenius wrote:
 This would be piuparts running the cron script directly, if I'm
 understanding things correctly. (That's a new feature. Cool.)

indeed :)

there is also a new test for logrotate scripts, but #582630
 
 Also, the cron script gets run after the package has been removed, and
 before it is purged. So the problem is that ikiwiki-hosting-web-daily
 and the other ikiwiki commands are not installed. Ergo, the cron script
 should test for them being there, before doing anything?

right :)

 Assuming that's correct, patch attached.

I assume the patch is correct :) (havent looked).


cheers,
Holger



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#625815: ikiwiki-hosting-web: cronjob exits with error after package removal

2011-05-06 Thread Lars Wirzenius
On pe, 2011-05-06 at 10:07 +0200, Holger Levsen wrote:
 during a test with piuparts I noticed your packages cronjob exits with 
 error (and has output) after the package has been removed. 
 
 From the attached log (scroll to the bottom...):
 
 1m1.4s INFO: Running scripts post_remove
 1m1.4s INFO: Package ikiwiki-hosting-web contains cron file: 
 /etc/cron.daily/ikiwiki-hosting-web
 1m1.4s DEBUG: Starting command: ['chroot', 
 '/org/piuparts.debian.org/tmp/tmpKrBNnA', '/etc/cron.daily/ikiwiki-hosting-
 web']
 1m1.4s DUMP: 
   ionice: execvp failed: No such file or directory
   ionice: execvp failed: No such file or directory
   /etc/cron.daily/ikiwiki-hosting-web: 10: ikisite-delete-unfinished-site: 
 not 
 found
 1m1.4s ERROR: Command failed (status=127): ['chroot', 
 '/org/piuparts.debian.org/tmp/tmpKrBNnA', '/etc/cron.daily/ikiwiki-hosting-
 web']
   ionice: execvp failed: No such file or directory
   ionice: execvp failed: No such file or directory
   /etc/cron.daily/ikiwiki-hosting-web: 10: ikisite-delete-unfinished-site: 
 not 
 found

This would be piuparts running the cron script directly, if I'm
understanding things correctly. (That's a new feature. Cool.)

Also, the cron script gets run after the package has been removed, and
before it is purged. So the problem is that ikiwiki-hosting-web-daily
and the other ikiwiki commands are not installed. Ergo, the cron script
should test for them being there, before doing anything?

Assuming that's correct, patch attached.
--- debian/ikiwiki-hosting-web.cron.daily.orig	2011-05-06 23:36:50.0 +0100
+++ debian/ikiwiki-hosting-web.cron.daily	2011-05-06 23:41:58.0 +0100
@@ -1,11 +1,19 @@
 #!/bin/sh
 # Compact and maintain all sites. This is a low-priority background job.
 # It can be a bit noisy, so chronic is used to only show output on error.
-nice -n 19 ionice -c 3 chronic ikiwiki-hosting-web-daily
+if command -v ikiwiki-hosting-web-daily  /dev/null
+then
+nice -n 19 ionice -c 3 chronic ikiwiki-hosting-web-daily
+fi
 
 # Backup sites once a day.
-nice -n 19 ionice -c 3 chronic ikiwiki-hosting-web-backup
+if command -v ikiwiki-hosting-web-backup  /dev/null
+then
+nice -n 19 ionice -c 3 chronic ikiwiki-hosting-web-backup
+fi
 
 # Clean up unfinished sites. This produces output you probably want to see.
-ikisite-delete-unfinished-site --all
-
+if command -v ikisite-delete-unfinished-site  /dev/null
+then
+ikisite-delete-unfinished-site --all
+fi