Attached is a simple patch that uses an option to get the path
specified for the log file and use it with the init script. I've also
modified the script slightly to specify the variable USER as 'root' in
case it's not specified. Also, the init script options to stop debpool
will stop it by debpool's name. Stopping it by the executable path
failed since debpool would be running through perl. I've also set the
logfile to go to /var/log/debpool.log to make it system accessible and
to take advantage of logrotate.
diff -urN debpool_released/bin/debpool debpool/bin/debpool
--- debpool_released/bin/debpool        2007-12-03 14:10:49.000000000 -0500
+++ debpool/bin/debpool 2007-12-06 10:46:24.000000000 -0500
@@ -118,6 +118,14 @@
     die "$msg\n";
 }
 
+# Print the path set for the lockfile and exit. This is mainly used to run
+# debpool with start-stop-daemon.
+
+if ($Options{'get_lock_path'}) {
+    print "$Options{'lock_file'}\n";
+    exit 0;
+}
+
 # Obtain a lockfile. We should never run more than one occurance; it's too
 # likely that we'd step on our own toes.
 
diff -urN debpool_released/debian/rules debpool/debian/rules
--- debpool_released/debian/rules       2007-12-03 14:10:48.000000000 -0500
+++ debpool/debian/rules        2007-12-06 11:47:02.000000000 -0500
@@ -1,7 +1,5 @@
 #! /usr/bin/make -f
 
-# TODO: Switch to CDBS
-#
 # TODO: Auto-generate DebPool::Config (with pod2man, options:
 # --section=5 --name="DebPool::Config" --center="DebPool Configuration")
 
@@ -21,6 +19,8 @@
        dh_installexamples -i
        dh_installchangelogs -i
        dh_installman -i
+       dh_installinit -i
+       dh_installlogrotate -i
 
        dh_perl -i
 
diff -urN debpool_released/share/DebPool/Config.pm 
debpool/share/DebPool/Config.pm
--- debpool_released/share/DebPool/Config.pm    2007-12-03 14:10:49.000000000 
-0500
+++ debpool/share/DebPool/Config.pm     2007-12-06 10:46:10.000000000 -0500
@@ -505,6 +505,16 @@
 $Options{'lock_file'} = "$Options{'archive_dir'}/.lock";
 $OptionDefs{'lock_file'} = 'lock_file=s';
 
+=item B<get_lock_path> => I<get lock path>
+
+Display the full path set for the lock file and exit. This is mainly used
+to run debpool as a daemon with start-stop-daemon.
+
+=cut
+
+$Options{'get_lock_path'} = 0;
+$OptionDefs{'get_lock_path'} = 'get_lock_path!';
+
 =item B<compress_dists> = I<boolean>
 
 This determines whether or not compressed versions of the distribution

Attachment: debpool.init
Description: Binary data


Attachment: debpool.default
Description: Binary data

Attachment: debpool.logrotate
Description: Binary data

Reply via email to