netbsd-bugs@netbsd.org
[Top] [All Lists]

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

Subject: Re: bin/42642: /etc/rc.subr fails to recognize daemons started with #!/usr/bin/env
From: Ed Ravin
Date: Thu, 28 Jan 2010 19:25:02 +0000 UTC
The following reply was made to PR bin/42642; it has been noted by GNATS.

From: Ed Ravin <eravin@xxxxxxxxx>
To: gnats-bugs@xxxxxxxxxx
Cc: gnats-admin@xxxxxxxxxx, netbsd-bugs@xxxxxxxxxx, eravin@xxxxxxxxx
Subject: Re: bin/42642: /etc/rc.subr  fails to recognize daemons started
        with #!/usr/bin/env
Date: Thu, 28 Jan 2010 14:21:26 -0500

 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@xxxxxxxxxxx>
 > To: netbsd-bugs@xxxxxxxxxx
 > Cc: gnats-bugs@xxxxxxxxxx
 > 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@xxxxxxxxx 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.
 

<Prev in Thread] Current Thread [Next in Thread>
  • Re: bin/42642: /etc/rc.subr fails to recognize daemons started with #!/usr/bin/env, Ed Ravin <=