[PATCH] run freeside-queued in fg
Ricardo SIGNES
rjbs+freeside-devel at icgroup.com
Wed Jun 15 13:32:21 PDT 2005
This simple patch gives freeside-queued a -F option to run in the
foreground. This makes it trivial to run freeside-queued under (for
example) djb's daemontools.
--
rjbs
-------------- next part --------------
--- sisd/FS/bin/freeside-queued 2005-06-10 12:32:56.000000000 -0400
+++ icg/FS/bin/freeside-queued 2005-06-10 12:33:29.000000000 -0400
@@ -1,7 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -ws
use strict;
-use vars qw( $DEBUG $kids $max_kids %kids );
+use vars qw( $DEBUG $kids $max_kids %kids $F );
use POSIX qw(:sys_wait_h);
use IO::File;
use FS::UID qw(adminsuidsetup forksuidsetup driver_name dbh myconnect);
@@ -25,7 +25,7 @@
warn "starting daemonization (forking)\n" if $DEBUG;
#daemonize1('freeside-queued',$user); #to keep pid files unique w/multi installs
-daemonize1('freeside-queued');
+$F || daemonize1('freeside-queued');
warn "dropping privledges\n" if $DEBUG;
drop_root();
@@ -47,7 +47,7 @@
logfile( "/usr/local/etc/freeside/queuelog.". $FS::UID::datasrc );
warn "completing daemonization (detaching))\n" if $DEBUG;
-daemonize2();
+$F || daemonize2();
#--
More information about the freeside-devel
mailing list