NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/42642: /etc/rc.subr fails to recognize daemons started with #!/usr/bin/env



On Thu, Jan 28, 2010 at 05:55:02PM +0000, Alan Barrett wrote:
> The following reply was made to PR bin/42642; it has been noted by GNATS.
> 
> From: Alan Barrett <apb%cequrux.com@localhost>
> To: netbsd-bugs%NetBSD.org@localhost
> Cc: gnats-bugs%NetBSD.org@localhost
> Subject: Re: bin/42642: /etc/rc.subr  fails to recognize daemons started
>  with #!/usr/bin/env
> Date: Thu, 28 Jan 2010 19:53:39 +0200
> 
>  On Tue, 19 Jan 2010, eravin%panix.com@localhost wrote:
>  > If I build an rc.d script for an interpreted daemon, and the first
>  > line of the daemon is:
>  > 
>  >    #!/usr/bin/env ruby
>  > 
>  > Then rc.subr will fail with this error:
>  > 
>  >   WARNING: $command_interpreter /usr/local/bin/ruby != /usr/bin/env
>  
>  Does your rc.d script do any of the following, and if so, please give
>  details:
>  
>    * set the command_interpreter variable;

Yes, we set $command_interpreter to "/usr/local/bin/ruby".

>    * set any of the procname, pidfile, or command variables;
>    * invoke the check_process or check_pidfile functions;

None of those.

Here's a simple way to reproduce the problem:

------------------------ cut here -------------------- "frog.rc"
#!/bin/sh
#
# PROVIDE: frog
# REQUIRE: LOGIN

. /etc/rc.subr

# description: frog daemon
#

name="frog"
rcvar=$name
command=/home/frog/frog
command_interpreter=/usr/local/bin/perl-5.6.1

load_rc_config $name
run_rc_command "$1"

------------------------ cut here -------------------- "frog"
#!/usr/bin/env perl-5.6.1

print "Hello world!\n";

sleep(1000);
------------------------ cut here --------------------

No need to start the "frog" daemon, just run the RC script:

  $ ./frog.rc forcestatus
  ./frog.rc: WARNING: $command_interpreter /usr/local/bin/perl-5.6.1 != 
/usr/bin/env
  frog is not running.



Home | Main Index | Thread Index | Old Index