Date: Wed, 10 Jun 2009 20:21:20 -0600 From: Tim Judd <tajudd@gmail.com> To: Drew Tomlinson <drew@mykitchentable.net> Cc: freebsd-questions@freebsd.org Subject: Re: Help With rc.d Script Message-ID: <ade45ae90906101921t6073e1c8m996f0328eac887bb@mail.gmail.com> In-Reply-To: <4A3059F7.8080301@mykitchentable.net> References: <4A3059F7.8080301@mykitchentable.net>
next in thread | previous in thread | raw e-mail | index | archive | help
since the rc.d scripts (as much as lots of other scripts in BSD are..) are borne shell scripts, can't 'set -x' be in the script to show the flow of it running??? That's what I'd try first. --Tim On 6/10/09, Drew Tomlinson <drew@mykitchentable.net> wrote: > I installed a software named "urchin" on my FBSD 7.2 box. > Unfortunately, it didn't come with an rc.d script to automate startup > and shutdown. And even more unfortunately, I can't seem to get my head > around the concepts in "Practical rc.d scripting in BSD" > (http://www.freebsd.org/doc/en/articles/rc-scripting/rcng-daemon.html). > > This is the command that starts the app: > > /usr/local/urchin/bin/urchinctl > > And here are the options: > > Usage: urchinctl [-v] [-h] [-e] [-s|-w] [-p port] action > where: > -v prints out the version of urchinctl > -h prints out this information > -e activates encryption (SSL) in the webserver > -s performs the action on the Urchin scheduler ONLY > -w performs the action on the Urchin webserver ONLY > -p specifies the port for the webserver to listen on > > action is either: start, stop, restart, or status > > start: starts the webserver and scheduler > stop: stops the webserver and scheduler > restart: stops and then starts the webserver and scheduler > status: prints out whether the webserver and scheduler are running > > By default, the action is performed on both the webserver and the > schedulers unless the -s or -w options are specified > > All I want to do is create a script within the rc.d framework that runs > "/usr/local/urchin/bin/urchinctl start" when the system boots and > "/usr/local/urchin/bin/urchinctl stop" when the system shuts down. > > Following the examples in the guide mentioned above, here is my attempt > at that file: > > #!/bin/sh > # PROVIDE: urchin > # REQUIRE: NETWORKING > # KEYWORD: shutdown > # > # Add the following line to /etc/rc.conf to enable urchin: > # urchin_enable="YES" (bool): Set to "NO" by default. > # Set it to "YES" to enable urchin. > . /etc/rc.subr > name="urchin" > rcvar=`set_rcvar` > command="/usr/local/urchin/bin/urchinctl " > eval "${rcvar}=\${${rcvar}:-'NO'}" > load_rc_config $name > run_rc_command "$1" > > I have also ensured that 'urchin_enable="YES"' is in /etc/rc.conf. > However when I run the rc.d script, the urchinctl appears to run but > doesn't like whatever arguments that are passed. See this output: > > urchin# ./urchin-server start > Starting urchin. > > Usage: urchinctl [-v] [-h] [-e] [-s|-w] [-p port] action > <snipped rest of options already shown above> > > I'm sure I'm missing some simple concept. I'd really appreciate a kick > in the right direction. > > Thanks, > > Drew > > -- > Be a Great Magician! > Visit The Alchemist's Warehouse > > http://www.alchemistswarehouse.com > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ade45ae90906101921t6073e1c8m996f0328eac887bb>