[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-bugs
Subject:    Re: bin/42642: /etc/rc.subr  fails to recognize daemons started
From:       Ed Ravin <eravin () panix ! com>
Date:       2010-01-28 19:25:02
Message-ID: 20100128192502.568A763C2BC () www ! NetBSD ! org
[Download RAW message or body]

The following reply was made to PR bin/42642; it has been noted by GNATS.

From: Ed Ravin <eravin@panix.com>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, eravin@panix.com
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@cequrux.com>
 > To: netbsd-bugs@NetBSD.org
 > Cc: gnats-bugs@NetBSD.org
 > 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 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 list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic