Process tree updated to show daemon worker status/activity
Squashed commit of the following: commita785b88b43Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Aug 6 21:32:11 2014 +0100 complete daemon pstree updates commitf77bf5361fMerge:f519410fcb8195Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Aug 6 20:45:22 2014 +0100 Merge branch 'master' into og-proctitle commitf51941076fAuthor: Oliver Gorwits <oliver@cpan.org> Date: Tue Aug 5 22:14:58 2014 +0100 set proctitle on daemon
This commit is contained in:
		| @@ -29,7 +29,6 @@ use NetAddr::IP::Lite ':lower'; | ||||
| use List::Util 'sum'; | ||||
| use Role::Tiny::With; | ||||
| use MCE::Signal '-setpgrp'; | ||||
| setpgrp(0,0); # only portable variety of setpgrp | ||||
| use MCE; | ||||
|  | ||||
| # set temporary MCE files' location in home directory | ||||
| @@ -37,6 +36,9 @@ my $home = ($ENV{NETDISCO_HOME} || $ENV{HOME}); | ||||
| my $tmp_dir = ($ENV{NETDISCO_TEMP} || dir($home, 'tmp')); | ||||
| mkdir $tmp_dir if ! -d $tmp_dir; | ||||
|  | ||||
| setpgrp(0,0); # only portable variety of setpgrp | ||||
| $0 = 'netdisco-daemon: master'; | ||||
|  | ||||
| my $mce = MCE->new( | ||||
|   spawn_delay => 0.15, | ||||
|   job_delay   => 1.15, | ||||
| @@ -92,6 +94,7 @@ sub worker_factory { | ||||
|   return sub { | ||||
|     my $self = shift; | ||||
|     my $wid = $self->wid; | ||||
|     $0 = sprintf 'netdisco-daemon: worker #%s %s: init', $wid, lc($role); | ||||
|     info "applying role $role to worker $wid"; | ||||
|  | ||||
|     # $self->sendto('stderr', ">>> worker $wid starting with role $role\n"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user