From c57f155a22c127b1a3154586d97ef6e1fd0d2156 Mon Sep 17 00:00:00 2001 From: Michael Legart Date: Wed, 18 Feb 2015 12:54:19 +0100 Subject: [PATCH] Print 'Started' before launching program when running in foreground We use Daemon::Control to launch hypnotoad (Mojolicious), but run with fork => 0 as hypnotoad does the forking. The 'Started' print statement in do_start() is never reached when not forking - so the init script does not give any response. --- lib/Daemon/Control.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Daemon/Control.pm b/lib/Daemon/Control.pm index 2d3dbb3..2be394e 100644 --- a/lib/Daemon/Control.pm +++ b/lib/Daemon/Control.pm @@ -266,7 +266,11 @@ sub _double_fork { return $self; } -sub _foreground { shift->_launch_program } +sub _foreground { + my $self = shift; + $self->pretty_print( "Started" ); + $self->_launch_program +} sub _fork { my ( $self ) = @_;