Date: Thu, 6 Dec 2012 20:45:50 +0000 From: Chris Rees <crees@FreeBSD.org> To: Paul Schmehl <pschmehl_lists@tx.rr.com>, "freebsd-rc@freebsd.org" <freebsd-rc@freebsd.org> Cc: FreeBSD Ports List <freebsd-ports@freebsd.org> Subject: Re: rc.subr questions Message-ID: <CADLo838ty4_ryGLQo9h5Ze2oA0WXvX3Yc4vV9Ei9HjG0whLkfg@mail.gmail.com> In-Reply-To: <DC59D265988CEDF1F3DC5C6D@utd71538.campus.ad.utdallas.edu> References: <DC59D265988CEDF1F3DC5C6D@utd71538.campus.ad.utdallas.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
[CC rc@] On 6 December 2012 20:36, Paul Schmehl <pschmehl_lists@tx.rr.com> wrote: > I'm trying to figure out how to get an rc.subr script to start and stop a > script. > > This works from the commandline (to start it): > tclsh /usr/local/bin/dir/script -D -c /usr/local/etc/conffile > > I've tried various combinations of: > > command_interpreter > argument_precmd > command_args > > but I keep getting this error: > unknown directive '/usr/local/bin/sguil-sensor/pads_agent.tcl' > > Doesn't matter if I make that string the val for command and don't use > command_interpreter or do use command_interpreter. > > I've read the man page over and over, but I'm clueless as to how to use > run_rc_script, which I *think* is the right way to call this script. > Make the script executable, put a shebang in; #!/usr/bin/env tclsh #!/bin/sh . /etc/rc.subr name=tclshexample rcvar=tclshexample_enable load_rc_config $name : ${tclshexample_enable=YES} command="/usr/local/bin/dir/script" command_interpreter=tclsh command_args="-D -c /usr/local/etc/conffile" run_rc_command $@ http://www.bayofrum.net/~crees/scratch/tclshexample Would be much easier if you were to provide specifics or the actual script :) Chris
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo838ty4_ryGLQo9h5Ze2oA0WXvX3Yc4vV9Ei9HjG0whLkfg>