[Dancer-users] giving the Dancer process via Starman a name
Nicolas
me at eboxr.com
Fri Sep 2 18:07:15 CEST 2011
Indeed this is a Starman question, processes names are setup in
Starman/Server.pm ( function below ) setting $0 in parent and child.
No option allow you to modify the name at this day, but why not submit such
a patch to Starman if you really need to replace it, by replacing starman by
an optional value given in option for example.
nicolas
___________________
sub run_parent {
my $self = shift;
$0 = "starman master " . join(" ", @{$self->{options}{argv} || []});
$self->SUPER::run_parent(@_);
}
# The below methods run in the child process
sub child_init_hook {
my $self = shift;
srand();
if ($self->{options}->{psgi_app_builder}) {
DEBUG && warn "[$$] Initializing the PSGI app\n";
$self->{app} = $self->{options}->{psgi_app_builder}->();
}
$0 = "starman worker " . join(" ", @{$self->{options}{argv} || []});
}
2011/9/2 David Precious <davidp at preshweb.co.uk>
> On Friday 02 September 2011 14:25:48 Mr. Puneet Kishor wrote:
> > when I run
> >
> > `plackup -s Starman -p 5006 -w 10 -E development --access-log
> > /path/to/app_access.log --error-log /path/to/app_error.log -D --pid
> > /path/to/app.pid -a /path/to/app/bin/app.pl`
> >
> > it shows up in `ps` as 'starman master' and 'starman worker'
> >
> > punkish at Lucknow ~/bin$ps -fax | grep '[s]tarman'
> > 501 4882 1 0 7:54AM ?? 0:00.04 starman master
> > 501 4883 4882 0 7:54AM ?? 0:00.00 starman worker
> > 501 4884 4882 0 7:54AM ?? 0:00.00 starman worker
> > 501 4885 4882 0 7:54AM ?? 0:00.00 starman worker
> > 501 4886 4882 0 7:54AM ?? 0:00.00 starman worker
> > 501 4887 4882 0 7:54AM ?? 0:00.00 starman worker
> >
> > Is there anyway I can make those processes have specific names, for
> > example, 'app master' and 'app worker" in the above instance?
>
> I believe if your app was to assign to $0, it would change that, but that's
> a
> bit dirty and hackish, I think.
>
> As Sawyer said, it's really more of a Plack/Starman question than Dancer-
> specific; I don't think we have anything in particular which could help
> you.
>
> If, however, we find there's an easy way for an app to tell Plack/Starman a
> process name to use, it would be nice to be able to add that facility to
> Dancer.
>
>
>
> --
> David Precious ("bigpresh")
> http://www.preshweb.co.uk/
>
> "Programming is like sex. One mistake and you have to support
> it for the rest of your life". (Michael Sinz)
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110902/3300e89f/attachment.htm>
More information about the Dancer-users
mailing list