From owner-freebsd-rc@FreeBSD.ORG Thu Dec 6 20:46:23 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46A92622; Thu, 6 Dec 2012 20:46:23 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 852438FC0C; Thu, 6 Dec 2012 20:46:21 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so3453276bkc.13 for ; Thu, 06 Dec 2012 12:46:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=oSnzTUuCT8O+jmv+L7Mw/ZBADPIWpglmxoCr/5tebPU=; b=KkFZhVNZR0lDW+/26rNwBgznHtRD00u/U43WUMYtcPhSVBAvRPNzMqaEeO74D1McHQ u+59z1vxfIAgMDxE89YaWs1pyEAvvCCH/q/NaiN0b1QfTm5yzJipRWAw9n8QR0pfhNVG SkWZclZRCYtGC0duucrwwAk1XmIFKM1mIgUHtUifWCO8balWunlnv8fspfmHkiOSBRtH bQRTcABwGj+Iq8dGOB2MvR0bfoaAv1fuPYrTdYg7O9vUv8qqiDm0waWUfFWdDstLqWAz j+jG4Ab/yGSss64ffYQ9x0csNzBZoOts5EKwnzyUQ1/Gijr/RuzK4U7Jhm1ghZkvAi/6 GU9Q== Received: by 10.204.143.147 with SMTP id v19mr1174401bku.32.1354826780926; Thu, 06 Dec 2012 12:46:20 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.204.167.71 with HTTP; Thu, 6 Dec 2012 12:45:50 -0800 (PST) In-Reply-To: References: From: Chris Rees Date: Thu, 6 Dec 2012 20:45:50 +0000 X-Google-Sender-Auth: u4LusoMQ00MmmQyXIhrSnNV436c Message-ID: Subject: Re: rc.subr questions To: Paul Schmehl , "freebsd-rc@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Ports List X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 20:46:23 -0000 [CC rc@] On 6 December 2012 20:36, Paul Schmehl 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