I'm trying to create a rc.d script for a Perl service. The perl script can restart it self. It does that by executing
The Perl script is able to provide a correct PID file at any time but the check_pidfile routine also checks the executable name which only works if command_interpeter is set to
Does anyone have any idea how to proceed from here?
[1] http://perldoc.perl.org/perlvar.html#$EXECUTABLE_NAME
exec $^X ...[1]
. The problem is that when it is first started it uses the shebang to execute Perl which results in a ps entry like /usr/bin/perl /path/to/myScript.pl
but after the restart the ps entry is /usr/local/bin/perl5 /path/to/myScript.pl
. That confuses the rc.subr() routines and it cannot detect the running program anymore.The Perl script is able to provide a correct PID file at any time but the check_pidfile routine also checks the executable name which only works if command_interpeter is set to
/usr/bin/perl
.Does anyone have any idea how to proceed from here?
[1] http://perldoc.perl.org/perlvar.html#$EXECUTABLE_NAME