From owner-freebsd-rc@FreeBSD.ORG Sun Dec 2 00:30:16 2012 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8439F77B; Sun, 2 Dec 2012 00:30:16 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1FDBC8FC13; Sun, 2 Dec 2012 00:30:16 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id 16so1898501obc.13 for ; Sat, 01 Dec 2012 16:30:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=XsM5LLbahjEMkxSHdy5prmXFXDUcfWJ5b8m14Aj80NU=; b=cRCemk/aFJ/tmtFBq3s42ND0xFpnUn2vYB134soknpu8Ag29BXpiHncxjnMN92VRQa 1nyuoCzf2qCvK2cOR+ezLdOvC9gFuCRiyzqC8su4ajSF3T0PNujnrvPV36SD7JHQEwtm n4zy7qeJxbA7FjhA6T5wtnrnbSwg85XLnpWyUiMB63FvHwo5B6IzHpU8zN/AVFsePNfU avNDqv3tv512YYJQnwFBMPnAWwhekUupmAcmeF9rPiluzApwlg4VGmB8qd/xCRi6862l sR6f0f0UXLRMGbZ8nafE+8meK+ADV7dPcYPmYEuV/I5cs5KJel3F4kT3lReIKiaFT6NN GbkA== MIME-Version: 1.0 Received: by 10.60.25.227 with SMTP id f3mr4996234oeg.17.1354408215466; Sat, 01 Dec 2012 16:30:15 -0800 (PST) Received: by 10.76.143.33 with HTTP; Sat, 1 Dec 2012 16:30:15 -0800 (PST) In-Reply-To: <20121201233756.GS3013@kib.kiev.ua> References: <20121202.015048.1122480556487090170.hrs@allbsd.org> <20121202.082150.896017277887885294.hrs@allbsd.org> <20121201233756.GS3013@kib.kiev.ua> Date: Sat, 1 Dec 2012 16:30:15 -0800 Message-ID: Subject: Re: RFC: sysctl -f filename From: Garrett Cooper To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: rc@freebsd.org, current@freebsd.org 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: Sun, 02 Dec 2012 00:30:16 -0000 On Sat, Dec 1, 2012 at 3:37 PM, Konstantin Belousov wrote: > On Sun, Dec 02, 2012 at 08:21:50AM +0900, Hiroki Sato wrote: >> Garrett Cooper wrote >> in : >> >> ya> On Sat, Dec 1, 2012 at 2:10 PM, Garrett Cooper wrote: >> ya> > Why change the tool when we can change the rc script to do the >> ya> > right thing? I have a patch I'm working on to resolve this (you hit an >> ya> > itch I've been meaning to scratch for a little while). >> ya> >> ya> This should work. I also refactored the script to get it down to >> ya> 80 columns. I've attached the debug output and the diff for the debug >> ya> version of the script. >> >> You will find out the following test case does not work (this is one >> of the test strings I used): >> >> kern.domainname="c$EDITOR.\"\ hoge\ \"\#hoge2\\$ \# h$$\#oge"# >> >> The reason why I changed sysctl(8) was that the rc.d/sysctl script >> was too complex and slow even if it could support meta characters in >> shell script syntax. I created several prototypes as script but >> noticed that keeping consistency was quite difficult and >> maintainability was poor due to tricky handling of variables. >> >> Although my patch in the previous email does not support meta >> characters completely, I still think it is more reasonable to >> implement this functionality on the sysctl(8) side. > > I fully agree with the proposal to add the -f switch to the sysctl(8). > This is consistent with several other administrative tools. Putting > the ability to parse and apply arbitrary sysctl.conf-like file into > the rc script is weird. The point was to augment rc.d/sysctl to do the right thing in most sane cases. What's shown above frankly doesn't make sense for a domain name, and while I agree that it's a good negative test, it seems a bit on the insane side for a real world example. I was trying to provide an alternative using an existing functioning system, instead of having to go and hack a widely used utility to function in a way that isn't standard. With that in mind, reviewing the original proposed code... ... +.It Fl f Ar filename +Specify a file which contains a pair of name and value in each line. +.Nm +reads and processes the specified file first and then processes the name +and value pairs in the command line argument. gcooper> This doesn't discuss the file format in complete, gory detail, and no examples were added to aid the reader in how things can be done in the new world order. .It Fl h Format output for human, rather than machine, readability. .It Fl i Index: sbin/sysctl/sysctl.c =================================================================== --- sbin/sysctl/sysctl.c (revision 243756) +++ sbin/sysctl/sysctl.c (working copy) @@ -56,13 +56,16 @@ #include #include #include +#include #include +static const char *conffile; static int aflag, bflag, dflag, eflag, hflag, iflag; -static int Nflag, nflag, oflag, qflag, xflag, warncount; +static int Nflag, nflag, oflag, qflag, xflag; static int oidfmt(int *, int, char *, u_int *); -static void parse(char *); +static int parsefile(const char *); +static int parse(char *, int); static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); @@ -74,7 +77,7 @@ { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqx] name[=value] ...", + "usage: sysctl [-bdehiNnoqx] [-f filename] name[=value] ...", " sysctl [-bdehNnoqx] -a"); exit(1); } @@ -83,12 +86,13 @@ main(int argc, char **argv) { int ch; + int warncount = 0; gcooper> style bug. setlocale(LC_NUMERIC, ""); setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabdehiNnoqwxX")) != -1) { + while ((ch = getopt(argc, argv, "Aabdef:hiNnoqwxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -106,6 +110,9 @@ case 'e': eflag = 1; break; + case 'f': + conffile = strdup(optarg); gcooper> Not checking for != NULL. ... /* @@ -160,8 +169,8 @@ * Lookup and print out the MIB entry if it exists. * Set a new value if requested. */ -static void -parse(char *string) +static int +parse(char *string, int lineno) gcooper> Since this is being modified, could string be changed to const char * for completeness? ... @@ -191,15 +213,20 @@ if (len < 0) { if (iflag) - return; - if (qflag) + return (1); gcooper> This should be return (0); + if (qflag) exit(1); else - errx(1, "unknown oid '%s'", bufp); + errx(1, "unknown oid '%s'%s", bufp, line); } - if (oidfmt(mib, len, fmt, &kind)) - err(1, "couldn't find format of oid '%s'", bufp); + if (oidfmt(mib, len, fmt, &kind)) { + warn("couldn't find format of oid '%s'%s", bufp, line); + if (!iflag) + exit(1); + else + return (1); gcooper> This should be arguably be `return (0);` too. ... +static int +parsefile(const char *filename) +{ + FILE *file; + char line[BUFSIZ], *p; + int warncount = 0, lineno = 0; gcooper> Style bugs (declaring and initializing on the same line). + + file = fopen(filename, "r"); + if (file == NULL) + err(EX_NOINPUT, "%s", filename); + while (fgets(line, sizeof(line), file) != NULL) { + lineno++; + p = line; + /* Replace the first # with \0. */ + while((p = strchr(p, '#')) != NULL) { gcooper> Style bug (needs space between `while` and `(`). + if (p == line || *(p-1) != '\\') { gcooper> Why are you allowing '\#' ? + *p = '\0'; ... static int Index: etc/rc.d/sysctl =================================================================== --- etc/rc.d/sysctl (revision 243756) +++ etc/rc.d/sysctl (working copy) @@ -8,51 +8,27 @@ . /etc/rc.subr name="sysctl" +command=/sbin/sysctl gcooper> Please quote this for consistency with the bulk majority of rc.d scripts. From owner-freebsd-rc@FreeBSD.ORG Sun Dec 2 03:32:02 2012 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64DCA176; Sun, 2 Dec 2012 03:32:02 +0000 (UTC) (envelope-from mureninc@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0FC058FC0C; Sun, 2 Dec 2012 03:32:01 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id s9so3238579iec.13 for ; Sat, 01 Dec 2012 19:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=cZtvEVfNn/+hFORpgLQVXdrWH9gUOIwIMkcldhkPzNQ=; b=EMkTfREC5PhR8IxrVYsKWxn3LbjcHzc5R/pmyky7Gc3AWO6ecsbc5j4k1eplxLQu05 ag/BoqFwDJXuepBoSJT3BiEobFXikCzhyVUUDjOjuZcYtn2ZakzhmHkIhbN4yasSwfWv yKGLAgS0DZVJI1xG0VSch2VV40OOpBPjKOlb8QF2gteSplkNYfuygbBKtr+fTubvaSsB Ue0lghdWjYBJDRyDJkHGFs5gDfGKdXNyHwpYSrgfuOqe4ZdHvWNbRd2C/FOdPKnckkXh uJ5iZbCQ6W/0pK1fOkh/veypnd31DWNPYTXexFTts0kY9iHvnfr7OMUbqGJwjr12omqJ t2Xg== MIME-Version: 1.0 Received: by 10.50.152.236 with SMTP id vb12mr2919192igb.15.1354419120951; Sat, 01 Dec 2012 19:32:00 -0800 (PST) Received: by 10.64.166.66 with HTTP; Sat, 1 Dec 2012 19:32:00 -0800 (PST) In-Reply-To: References: <20121202.015048.1122480556487090170.hrs@allbsd.org> <20121202.082150.896017277887885294.hrs@allbsd.org> <20121201233756.GS3013@kib.kiev.ua> Date: Sat, 1 Dec 2012 19:32:00 -0800 Message-ID: Subject: Re: RFC: sysctl -f filename From: "Constantine A. Murenin" To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Cc: rc@freebsd.org, current@freebsd.org 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: Sun, 02 Dec 2012 03:32:02 -0000 On 1 December 2012 16:30, Garrett Cooper wrote: > On Sat, Dec 1, 2012 at 3:37 PM, Konstantin Belousov wrote: >> On Sun, Dec 02, 2012 at 08:21:50AM +0900, Hiroki Sato wrote: >>> Garrett Cooper wrote >>> in : >>> >>> ya> On Sat, Dec 1, 2012 at 2:10 PM, Garrett Cooper wrote: >>> ya> > Why change the tool when we can change the rc script to do the >>> ya> > right thing? I have a patch I'm working on to resolve this (you hit an >>> ya> > itch I've been meaning to scratch for a little while). >>> ya> >>> ya> This should work. I also refactored the script to get it down to >>> ya> 80 columns. I've attached the debug output and the diff for the debug >>> ya> version of the script. >>> >>> You will find out the following test case does not work (this is one >>> of the test strings I used): >>> >>> kern.domainname="c$EDITOR.\"\ hoge\ \"\#hoge2\\$ \# h$$\#oge"# >>> >>> The reason why I changed sysctl(8) was that the rc.d/sysctl script >>> was too complex and slow even if it could support meta characters in >>> shell script syntax. I created several prototypes as script but >>> noticed that keeping consistency was quite difficult and >>> maintainability was poor due to tricky handling of variables. >>> >>> Although my patch in the previous email does not support meta >>> characters completely, I still think it is more reasonable to >>> implement this functionality on the sysctl(8) side. >> >> I fully agree with the proposal to add the -f switch to the sysctl(8). >> This is consistent with several other administrative tools. Putting >> the ability to parse and apply arbitrary sysctl.conf-like file into >> the rc script is weird. > > The point was to augment rc.d/sysctl to do the right thing in most > sane cases. What's shown above frankly doesn't make sense for a domain > name, and while I agree that it's a good negative test, it seems a bit > on the insane side for a real world example. > I was trying to provide an alternative using an existing > functioning system, instead of having to go and hack a widely used > utility to function in a way that isn't standard. Since when sysctl(8) is standard and the "-f file" option is not? http://man.NetBSD.org/man/sysctl+8 I also agree with the proposal that adding "-f file" directly to sysctl(8) sounds like a much better approach than going through the non-standard (and slow) rc.d route. > With that in mind, reviewing the original proposed code... > > ... > > +.It Fl f Ar filename I think this might be s/filename/file/, e.g. as in at(1), apmd(8), boot0cfg(8), bsdlabel(8), devd(8), restore(8), pfctl(8) etc. > +Specify a file which contains a pair of name and value in each line. > +.Nm > +reads and processes the specified file first and then processes the name > +and value pairs in the command line argument. > > gcooper> This doesn't discuss the file format in complete, gory > detail, and no examples were added to aid the reader in how things can > be done in the new world order. +1. Also, note that NetBSD's sysctl(8) supports line continuation with "\"; is this something that would at all be useful for sysctl? Then it should probably be implemented and documented from the start, to ensure that we don't have to needlessly break backwards compatibility with a future change. > > .It Fl h > Format output for human, rather than machine, readability. > .It Fl i > Index: sbin/sysctl/sysctl.c > =================================================================== > --- sbin/sysctl/sysctl.c (revision 243756) > +++ sbin/sysctl/sysctl.c (working copy) > @@ -56,13 +56,16 @@ > #include > #include > #include > +#include > #include > > +static const char *conffile; > static int aflag, bflag, dflag, eflag, hflag, iflag; > -static int Nflag, nflag, oflag, qflag, xflag, warncount; > +static int Nflag, nflag, oflag, qflag, xflag; > > static int oidfmt(int *, int, char *, u_int *); > -static void parse(char *); > +static int parsefile(const char *); > +static int parse(char *, int); > static int show_var(int *, int); > static int sysctl_all(int *oid, int len); > static int name2oid(char *, int *); > @@ -74,7 +77,7 @@ > { > > (void)fprintf(stderr, "%s\n%s\n", > - "usage: sysctl [-bdehiNnoqx] name[=value] ...", > + "usage: sysctl [-bdehiNnoqx] [-f filename] name[=value] ...", I think the "-f file" should be a separate usage paradigm here, and, most likely, it should not be possible to use both "-f file" and "name[=value]". > " sysctl [-bdehNnoqx] -a"); > exit(1); > } > @@ -83,12 +86,13 @@ > main(int argc, char **argv) > { > int ch; > + int warncount = 0; > > gcooper> style bug. > > setlocale(LC_NUMERIC, ""); > setbuf(stdout,0); > setbuf(stderr,0); > > - while ((ch = getopt(argc, argv, "AabdehiNnoqwxX")) != -1) { > + while ((ch = getopt(argc, argv, "Aabdef:hiNnoqwxX")) != -1) { > switch (ch) { > case 'A': > /* compatibility */ > @@ -106,6 +110,9 @@ > case 'e': > eflag = 1; > break; > + case 'f': > + conffile = strdup(optarg); > > gcooper> Not checking for != NULL. > > ... > > /* > @@ -160,8 +169,8 @@ > * Lookup and print out the MIB entry if it exists. > * Set a new value if requested. > */ > -static void > -parse(char *string) > +static int > +parse(char *string, int lineno) > > gcooper> Since this is being modified, could string be changed to > const char * for completeness? > > ... > > @@ -191,15 +213,20 @@ > > if (len < 0) { > if (iflag) > - return; > - if (qflag) > + return (1); > > gcooper> This should be return (0); > > + if (qflag) > exit(1); > else > - errx(1, "unknown oid '%s'", bufp); > + errx(1, "unknown oid '%s'%s", bufp, line); > } > > - if (oidfmt(mib, len, fmt, &kind)) > - err(1, "couldn't find format of oid '%s'", bufp); > + if (oidfmt(mib, len, fmt, &kind)) { > + warn("couldn't find format of oid '%s'%s", bufp, line); > + if (!iflag) > + exit(1); > + else > + return (1); > > gcooper> This should be arguably be `return (0);` too. > > ... > > +static int > +parsefile(const char *filename) > +{ > + FILE *file; > + char line[BUFSIZ], *p; > + int warncount = 0, lineno = 0; > > gcooper> Style bugs (declaring and initializing on the same line). Not according to style(9): http://www.freebsd.org/cgi/man.cgi?query=style&sektion=9&manpath=FreeBSD+9.0-RELEASE << Be careful to not obfuscate the code by initializing variables in the declarations. Use this feature only thoughtfully. DO NOT use function calls in initializers. >> I think the above initialisations are just fine and used thoughtfully. C. > > + > + file = fopen(filename, "r"); > + if (file == NULL) > + err(EX_NOINPUT, "%s", filename); > + while (fgets(line, sizeof(line), file) != NULL) { > + lineno++; > + p = line; > + /* Replace the first # with \0. */ > + while((p = strchr(p, '#')) != NULL) { > > gcooper> Style bug (needs space between `while` and `(`). > > + if (p == line || *(p-1) != '\\') { > > gcooper> Why are you allowing '\#' ? > > + *p = '\0'; > > ... > > static int > Index: etc/rc.d/sysctl > =================================================================== > --- etc/rc.d/sysctl (revision 243756) > +++ etc/rc.d/sysctl (working copy) > @@ -8,51 +8,27 @@ > . /etc/rc.subr > > name="sysctl" > +command=/sbin/sysctl > > gcooper> Please quote this for consistency with the bulk majority of > rc.d scripts. From owner-freebsd-rc@FreeBSD.ORG Sun Dec 2 19:01:22 2012 Return-Path: Delivered-To: freebsd-rc@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0CC95891; Sun, 2 Dec 2012 19:01:22 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id CCC448FC18; Sun, 2 Dec 2012 19:01:21 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qB2J1LhX070447; Sun, 2 Dec 2012 19:01:21 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qB2J1Ltu070443; Sun, 2 Dec 2012 19:01:21 GMT (envelope-from linimon) Date: Sun, 2 Dec 2012 19:01:21 GMT Message-Id: <201212021901.qB2J1Ltu070443@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Subject: Re: conf/174053: [patch] fix etc/rc.d/sysctl to work with values that contain spaces 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: Sun, 02 Dec 2012 19:01:22 -0000 Synopsis: [patch] fix etc/rc.d/sysctl to work with values that contain spaces Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Sun Dec 2 19:01:09 UTC 2012 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=174053 From owner-freebsd-rc@FreeBSD.ORG Mon Dec 3 07:50:01 2012 Return-Path: Delivered-To: freebsd-rc@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D133F94 for ; Mon, 3 Dec 2012 07:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3178FC08 for ; Mon, 3 Dec 2012 07:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qB37o12e015105 for ; Mon, 3 Dec 2012 07:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qB37o1Fw015103; Mon, 3 Dec 2012 07:50:01 GMT (envelope-from gnats) Date: Mon, 3 Dec 2012 07:50:01 GMT Message-Id: <201212030750.qB37o1Fw015103@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org Cc: From: Garrett Cooper Subject: Re: conf/159846: rc.conf routing_stop_inet6 logic doesn t handle ipv6_network_interfaces properly X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Garrett Cooper 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: Mon, 03 Dec 2012 07:50:01 -0000 The following reply was made to PR conf/159846; it has been noted by GNATS. From: Garrett Cooper To: bug-followup@FreeBSD.org, yanegomi@gmail.com Cc: Subject: Re: conf/159846: rc.conf routing_stop_inet6 logic doesn t handle ipv6_network_interfaces properly Date: Sun, 2 Dec 2012 23:41:37 -0800 (PST) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --967339439-1538670288-1354520501=:40941 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII This patch fixes the problem. Thanks, -Garrett --967339439-1538670288-1354520501=:40941 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=rc.d-routing-should-translate-ipv6-interfaces-properly.patch.txt Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=rc.d-routing-should-translate-ipv6-interfaces-properly.patch.txt SW5kZXg6IGV0Yy9yYy5kL3JvdXRpbmcNCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0NCi0tLSBldGMvcmMuZC9yb3V0aW5nCShyZXZpc2lvbiAyNDM4MDIpDQor KysgZXRjL3JjLmQvcm91dGluZwkod29ya2luZyBjb3B5KQ0KQEAgLTE3NSw2 ICsxNzUsOSBAQA0KIAlbTm5dW09vXVtObl1bRWVdKQ0KIAkJaXB2Nl9uZXR3 b3JrX2ludGVyZmFjZXM9JycNCiAJCTs7DQorCVtBYV1bVXVdW1R1XVtPb10p DQorCQlpcHY2X25ldHdvcmtfaW50ZXJmYWNlcz1gbGlzdF9uZXRfaW50ZXJm YWNlc2ANCisJCTs7DQogCWVzYWMNCiANCiAJaWYgY2hlY2t5ZXNubyBpcHY2 X2dhdGV3YXlfZW5hYmxlOyB0aGVuDQo= --967339439-1538670288-1354520501=:40941-- From owner-freebsd-rc@FreeBSD.ORG Mon Dec 3 11:06:51 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 276D5E1 for ; Mon, 3 Dec 2012 11:06:51 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 09A888FC14 for ; Mon, 3 Dec 2012 11:06:51 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3B6ohH027682 for ; Mon, 3 Dec 2012 11:06:50 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qB3B6o1k027680 for freebsd-rc@FreeBSD.org; Mon, 3 Dec 2012 11:06:50 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 3 Dec 2012 11:06:50 GMT Message-Id: <201212031106.qB3B6o1k027680@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org 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: Mon, 03 Dec 2012 11:06:51 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/174053 rc [patch] fix etc/rc.d/sysctl to work with values that c o bin/173153 rc [rc.d] [patch] $netwait_ip should be more parallel o conf/172532 rc [rc] [patch] service routing restart always fails o conf/169373 rc mountd starts too early when exporting fs marked as la o conf/169047 rc [rc.subr] [patch] /etc/rc.subr not checking some scrip o bin/168544 rc [patch] [rc]: addswap-mounted swapfiles cause panic on o conf/167566 rc [rc.d] [patch] ipdivert module loading vs. ipfw rc.d o o conf/166484 rc [rc] [patch] rc.initdiskless patch for different major o conf/165769 rc [rc][jai][ipv6] IPv6 Initialization on external iface o conf/164393 rc [rc.d] restarting netif with static addresses doesn't o conf/163508 rc [rc.subr] [patch] Add "enable" and "disable" commands o conf/163488 rc Confusing explanation in defaults/rc.conf o conf/163321 rc [rc.conf] [patch] allow _fib syntax in rc.conf o conf/162642 rc .sh scripts in /usr/local/etc/rc.d get executed, not s p kern/161899 rc [route] ntpd(8): Repeating RTM_MISS packets causing hi o conf/161107 rc [rc] stop_boot in mountcritlocal usage is incorrect. o conf/160403 rc [rc] [patch] concurrently running rc-scripts during bo o conf/160240 rc rc.d/mdconfig and mdconfig2 should autoset $_type to v o conf/159846 rc [rc.conf] routing_stop_inet6() logic doesn't handle ip o conf/158557 rc [patch] /etc/rc.d/pf broken messages o conf/158127 rc [patch] remount_optional option in rc.initdiskless doe o conf/153666 rc [rc.d][patch] mount filesystems from fstab over zfs da o conf/153200 rc post-boot /etc/rc.d/network_ipv6 start can miss neighb o conf/153123 rc [rc] [patch] add gsched rc file to automatically inser o conf/150474 rc [patch] rc.d/accounting: Add ability to set location o o conf/149867 rc [PATCH] rc.d script to manage multiple FIBS (kern opti o conf/149831 rc [PATCH] add support to /etc/rc.d/jail for delegating Z o conf/148656 rc rc.firewall(8): {oip} and {iip} variables in rc.firewa o conf/147685 rc [rc.d] [patch] new feature for /etc/rc.d/fsck o conf/147444 rc [rc.d] [patch] /etc/rc.d/zfs stop not called on reboot o conf/146053 rc [patch] [request] shutdown of jails breaks inter-jail o conf/145399 rc [patch] rc.d scripts are unable to start/stop programs o conf/145009 rc [patch] rc.subr(8): rc.conf should allow mac label con o conf/143637 rc [patch] ntpdate(8) support for ntp-servers supplied by o conf/143085 rc [patch] ftp-proxy(8) rc(8) with multiple instances a conf/142973 rc [jail] [patch] Strange counter init value in jail rc o conf/142434 rc [patch] Add cpuset(1) support to rc.subr(8) o conf/142304 rc rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack e o conf/141909 rc rc.subr(8): [patch] add rc.conf.d support to /usr/loca o conf/141678 rc [patch] A minor enhancement to how /etc/rc.d/jail dete o conf/140440 rc [patch] allow local command files in rc.{suspend,resum o conf/140261 rc [patch] Improve flexibility of mdconfig2 startup scrip p conf/138208 rc [rc.d] [patch] Making rc.firewall (workstation) IPv6 a o conf/137271 rc [rc.d] Cannot update /etc/host.conf when root filesyst o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/134918 rc [patch] rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped o conf/124747 rc [patch] savecore can't create dump from encrypted swap o conf/124248 rc [jail] [patch] add support for nice value for rc.d/jai o conf/123734 rc [patch] Chipset VIA CX700 requires extra initializatio o conf/123222 rc [patch] Add rtprio(1)/idprio(1) support to rc.subr(8). p conf/123119 rc [patch] rc script for ipfw does not handle IPv6 o conf/122968 rc [rc.d] /etc/rc.d/addswap: md swapfile multiplication a o conf/122477 rc [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring o conf/122170 rc [patch] [request] New feature: notify admin via page o o kern/121566 rc [nfs] [request] [patch] ethernet iface should be broug a conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses f conf/118255 rc savecore never finding kernel core dumps (rcorder prob f conf/117935 rc [patch] ppp fails to start at boot because of missing f conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p f conf/105689 rc [ppp] [request] syslogd starts too late at boot f conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp f conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d f conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle a conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi a conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} f conf/56934 rc [patch] rc.firewall rules for natd expect an interface 82 problems total. From owner-freebsd-rc@FreeBSD.ORG Tue Dec 4 01:31:43 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 31FF6D64 for ; Tue, 4 Dec 2012 01:31:43 +0000 (UTC) (envelope-from prvs=1685a61a7f=evendas@krazer.com.br) Received: from krazer.com.br (usaimport.com.br [74.208.147.131]) by mx1.freebsd.org (Postfix) with ESMTP id DCD328FC2D for ; Tue, 4 Dec 2012 01:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=krazer.com.br; s=MDaemon; t=1354583462; x=1355188262; q=dns/txt; h=DomainKey-Signature: Received:From:To:Subject:Date:MIME-Version:Content-Type: Message-ID; bh=/AGF6JRzB/J7iTsWt8UkF/2jJ0/KNRujXWNnXTa6qHA=; b=S DtK5EW5NQHRgO80UctFCE0zscHfHRgetPl9IeoW2Ht9dGO0jy4lg6wGMpVhWm4Mr 9XhdqWnerXUqO5A2sF1y/FwaNN4dtgyLnOZUPbA3cVWGZRkaQHsUcy0355mdxFzI 5DJO7L+eba5H3DbCaUumYSzX3zc/uhDYfPAS/qrV3U= DomainKey-Signature: a=rsa-sha1; s=MDaemon; d=krazer.com.br; c=simple; q=dns; h=from:message-id; b=tMzX+HNEKtPV4sZKRBe1xs+G/gwpP6vE0w9OhEd3+/iD6+eYxXOL2pgBPxlR 29/365huhWKXEr/gEq7+oyvapnIRgxArw/p04oBzEOjOTHXyWZfykM96z t57hQrJDK3bTmWS9yPou/PUDNzoBMIiAtkucdizMpj94AFpvHnXOzg=; X-MDAV-Processed: allearth.com.br, Mon, 03 Dec 2012 23:11:02 -0200 Received: from krazer by allearth.com.br (MDaemon PRO v11.0.0) with ESMTP id md50003170661.msg for ; Mon, 03 Dec 2012 23:11:01 -0200 X-Spam-Processed: allearth.com.br, Mon, 03 Dec 2012 23:11:01 -0200 (not processed: message from trusted or authenticated source) X-Authenticated-Sender: evendas@krazer.com.br X-MDRemoteIP: 74.208.167.75 X-Return-Path: prvs=1685a61a7f=evendas@krazer.com.br X-Envelope-From: evendas@krazer.com.br X-MDaemon-Deliver-To: freebsd-rc@freebsd.org From: "Vendas Krazer Technologies" To: Subject: =?utf-8?B?Tm92YSBDUEUgS3JhemVyIFNreSBTdGF0aW9uIDVHSHo=?= =?utf-8?B?IE4gLSBDUEUgQW50ZW5hIEludGVncmFkYSBkZSAxOGRCaQ==?= =?utf-8?B?IGUgQ29tIFNhw61kYSBwYXJhIEFudGVuYSBFeHRlcm5h?= Date: Mon, 03 Dec 2012 22:08:17 -0200 MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=45652905_3502_4801_0078_850943129657" Message-ID: X-Mailer: Clientes Krazer X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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: Tue, 04 Dec 2012 01:31:43 -0000 This is a multi-part message in MIME format. ------=45652905_3502_4801_0078_850943129657 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lan=C3=A7amento CPE Krazer Sky Station 5GHz N Voc=C3=AA cliente pediu que a Krazer fizesse uma nova CPE num formato mais = estiloso, pequena, de menor tamanho e que tivesse novas funcionabilidade, m= ais especificamente acesso f=C3=A1cil ao bot=C3=A3o de reset, prote=C3=A7= =C3=A3o contra queima e a t=C3=A3o desejada SA=C3=8DDA PARA ANTENA EXTERNA!= !! R$ 179.90 Antena Integrada de 18dBi 60=C2=BA Duas Portas de Rede Lan e Wan PA Real de 630mW e LNA Ultra Ganho PoE Passivo com Prote=C3=A7=C3=A3o Dupla de 12 a 24V Fonte Chaveada 12V Full Range 110 a 220V Exclusiva Sa=C3=ADda para Antena Externa Homologa=C3=A7=C3=A3o Anatel 0269-11-5280 Instala=C3=A7=C3=A3o R=C3=A1pida e Simples. Software Amigavel e em Portugu=C3=AAs! Suporte a PPPoE Wisp Cliente! Controle de Banda! Excelente sinal de recep=C3=A7=C3=A3o! Longa Dist=C3=A2ncia! Fa=C3=A7a um teste em sua rede e compare com os concorrentes, muito mais si= nal que UBNT, muito mais dados, transmiss=C3=A3o de quase 90Mbps TCP/IP con= tinuamente! Lat=C3=AAncia de rede de 1 a 5 ms com carga completa! Contate-nos Val Campos // Carla Maria // Eder Roberto Email / MSN: vendas@allearth.com.br Vendas / SAC (19) 3256-5557 (19) 3245-0708 www.krazer.com.br Envio de Email n=C3=A3o autorizado =C3=A9 crime, n=C3=A3o seja o vil=C3=A3o= da hist=C3=B3ria! Email =C3=A9 protegido sobre sigilo fiscal e federal. Le= i Federal Brasil. ------=45652905_3502_4801_0078_850943129657-- 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 From owner-freebsd-rc@FreeBSD.ORG Thu Dec 6 21:10:50 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 7BA49CB; Thu, 6 Dec 2012 21:10:50 +0000 (UTC) (envelope-from prvs=680cec957=pschmehl_lists@tx.rr.com) Received: from ip-002.utdallas.edu (ip-002.utdallas.edu [129.110.20.108]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD6B8FC0C; Thu, 6 Dec 2012 21:10:48 +0000 (UTC) X-Group: None X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvIEAEMJwVCBbgogTmdsb2JhbABEFr4vAwEBboIeAQEFOAI/EAsOCi5DFAYBEogQDMJpjDmDYmEDiF+dDoNv X-IronPort-AV: E=Sophos;i="4.84,232,1355119200"; d="scan'208";a="107924467" Received: from zxtm01.utdallas.edu (HELO utd71538.utdallas.edu) ([129.110.10.32]) by ip-002.utdallas.edu with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Dec 2012 15:10:41 -0600 Date: Thu, 06 Dec 2012 15:10:40 -0600 From: Paul Schmehl To: Chris Rees , Paul Schmehl , freebsd-rc@freebsd.org Subject: Re: rc.subr questions Message-ID: <0FC50D96AC60C2D7BEFC786A@utd71538.campus.ad.utdallas.edu> In-Reply-To: References: X-Mailer: Mulberry/4.1.0a1 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline; size=3104 Cc: FreeBSD Ports List X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Paul Schmehl 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 21:10:50 -0000 --On December 6, 2012 8:45:50 PM +0000 Chris Rees wrote: > [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 It is. , put a shebang in; #!/usr/bin/env tclsh Here's the current script's starting lines: #!/bin/sh # Run tcl from users PATH \ exec tclsh "$0" "$@" > ># !/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 > Here's the rc script I'm working on. . /etc/rc.subr load_rc_config pads_agent #set defaults pads_agent_enable=${pads_agent_enable:-"NO"} pads_agent_conf=${pads_agent_conf:-"/usr/local/etc/sguil-sensor/pads_agent.conf"} pads_agent_flags="${pads_agent_flags}:-"-D -c ${pads_agent_conf}" name="pads_agent" rcvar=pads_agent_enable command="/usr/local/bin/sguil-sensor/pads_agent.tcl" command_interpreter="tclsh" command_args=${pads_agent_flags} run_rc_command "$@" Here's the error I'm getting when I run start: /usr/local/etc/rc.d/pads_agent: WARNING: $command_interpreter tclsh != /bin/sh Starting pads_agent. /usr/local/etc/rc.d/pads_agent: WARNING: $command_interpreter tclsh != /bin/sh /usr/local/etc/rc.d/pads_agent: unknown directive '/usr/local/bin/sguil-sensor/pads_agent.tcl'. Usage: /usr/local/etc/rc.d/pads_agent [fast|force|one|quiet](start|stop|restart|rcvar|status|poll) /usr/local/etc/rc.d/pads_agent: WARNING: failed to start pads_agent I tried changing the interpreter to "/bin/sh" but I got the same error. Here's the perms on the script: # ls -lsa /usr/local/bin/sguil-sensor/pads_agent.tcl 12 -r-xr-xr-x 1 root wheel 11662 Dec 6 18:31 /usr/local/bin/sguil-sensor/pads_agent.tcl -- Paul Schmehl, Senior Infosec Analyst As if it wasn't already obvious, my opinions are my own and not those of my employer. ******************************************* "It is as useless to argue with those who have renounced the use of reason as to administer medication to the dead." Thomas Jefferson "There are some ideas so wrong that only a very intelligent person could believe in them." George Orwell From owner-freebsd-rc@FreeBSD.ORG Thu Dec 6 21:21:39 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 2955A3C1; Thu, 6 Dec 2012 21:21:39 +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 73E978FC18; Thu, 6 Dec 2012 21:21:38 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so3467217bkc.13 for ; Thu, 06 Dec 2012 13:21:37 -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 :content-transfer-encoding; bh=tlBmb/oPZzhhjRkGurTI4icR5OoLgXjEaw35p6vimQg=; b=JC7he/LG01NI2RYvd9HAMLfl4TY94s1mLHqhXotETPxHxRAYBxo1AVpHx6Hu8TaecQ 0ZQVqX4BxuCMnoVAPBWapZogSkvmDxDvkzxf8B8Gv9+49qLKvd4LhHeEYc8iBMvp0Gq7 NgNS3wSjTfVkT1lcbPj7Xi9YG1VhrXmQLsfMJ2lv2h8ktwVUB1sIDWzaGNk3NXyBKGyk uK6GYaMTZiZXOFxMVu5LGETYgM+8r4fdC/eolFNGoK5eSwLKlTm4QJRYdaH45C+7Pc13 CptrXy5qLLdCa6eqHW9su7V4P1RVPU4LQN/2EcDM/8Q5VPFo/EU5nMjQy6QU04tKoToD tUJA== Received: by 10.204.143.147 with SMTP id v19mr1216309bku.32.1354828897370; Thu, 06 Dec 2012 13:21:37 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.204.167.71 with HTTP; Thu, 6 Dec 2012 13:21:07 -0800 (PST) In-Reply-To: <50C10BEB.7020700@passap.ru> References: <0FC50D96AC60C2D7BEFC786A@utd71538.campus.ad.utdallas.edu> <50C10BEB.7020700@passap.ru> From: Chris Rees Date: Thu, 6 Dec 2012 21:21:07 +0000 X-Google-Sender-Auth: uTNavj_AW3Qx1nyGT6jzfaByumU Message-ID: Subject: Re: rc.subr questions To: Boris Samorodov , "freebsd-rc@freebsd.org" Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Mailing 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 21:21:39 -0000 On 6 December 2012 21:19, Boris Samorodov wrote: > 07.12.2012 01:10, Paul Schmehl =D0=C9=DB=C5=D4: > >> command_interpreter=3D"tclsh" > > Shouldn't that be a full path rather than just the command name? I suppose it should, this was a scratch test. Please don't strip rc@. Chris From owner-freebsd-rc@FreeBSD.ORG Thu Dec 6 21:30:37 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 6BF3D891; Thu, 6 Dec 2012 21:30:37 +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 B3F928FC0C; Thu, 6 Dec 2012 21:30:36 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so3470445bkc.13 for ; Thu, 06 Dec 2012 13:30:35 -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=Bo0fYpCCj6VZ+wrIA3DJDcNXxJ9S5b6knd34OcCUBHc=; b=caHqctieYyBSMSHTzd1Nt188LSyP3vTt3UKVgPGcrIHfAh502JFq7pIefB/ne1bE0T CgVI84rvtez6vaN5yEk4jfkL74B1O+F2CgYbCc3AF7sAyv5bxJPxt/sRTpbQ6k10CJhJ H6pdpSWrA0r1vLWTTKLgpK/CAORC8w3No0tV7MM3LU63Kd/SS00oKcQEgPO24XVJFsDU JxjbQzbb6thO82/lo39YB/PVsk7CrL0ZYbXqR0PFyUCPbffuKFHNcnlDvIo1kQI4f0aI RDgT5nW52s8mVki68F4P3mRVR8a92GD9US8thjVlRevOq9rEsKYhzI4NsuGolbXkc86X 7n5Q== Received: by 10.204.11.208 with SMTP id u16mr1289341bku.81.1354829435675; Thu, 06 Dec 2012 13:30:35 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.204.167.71 with HTTP; Thu, 6 Dec 2012 13:30:04 -0800 (PST) In-Reply-To: <0FC50D96AC60C2D7BEFC786A@utd71538.campus.ad.utdallas.edu> References: <0FC50D96AC60C2D7BEFC786A@utd71538.campus.ad.utdallas.edu> From: Chris Rees Date: Thu, 6 Dec 2012 21:30:04 +0000 X-Google-Sender-Auth: hMnDHRsNmcEI-smqI07T-OyQpSE Message-ID: Subject: Re: rc.subr questions To: Paul Schmehl Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-rc@freebsd.org" , 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 21:30:37 -0000 On 6 December 2012 21:10, Paul Schmehl wrote: > --On December 6, 2012 8:45:50 PM +0000 Chris Rees wrote: > >> [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 > > > It is. > > > , put a shebang in; #!/usr/bin/env tclsh > > Here's the current script's starting lines: > > #!/bin/sh > # Run tcl from users PATH \ > exec tclsh "$0" "$@" >> >> >> # !/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 >> > > Here's the rc script I'm working on. > > . /etc/rc.subr > > load_rc_config pads_agent > > #set defaults > pads_agent_enable=${pads_agent_enable:-"NO"} > pads_agent_conf=${pads_agent_conf:-"/usr/local/etc/sguil-sensor/pads_agent.conf"} > pads_agent_flags="${pads_agent_flags}:-"-D -c ${pads_agent_conf}" > > name="pads_agent" > rcvar=pads_agent_enable > > command="/usr/local/bin/sguil-sensor/pads_agent.tcl" > command_interpreter="tclsh" > command_args=${pads_agent_flags} > > run_rc_command "$@" > > Here's the error I'm getting when I run start: > > /usr/local/etc/rc.d/pads_agent: WARNING: $command_interpreter tclsh != > /bin/sh > Starting pads_agent. > /usr/local/etc/rc.d/pads_agent: WARNING: $command_interpreter tclsh != > /bin/sh > /usr/local/etc/rc.d/pads_agent: unknown directive > '/usr/local/bin/sguil-sensor/pads_agent.tcl'. > Usage: /usr/local/etc/rc.d/pads_agent > [fast|force|one|quiet](start|stop|restart|rcvar|status|poll) > /usr/local/etc/rc.d/pads_agent: WARNING: failed to start pads_agent > > I tried changing the interpreter to "/bin/sh" but I got the same error. > > Here's the perms on the script: > > # ls -lsa /usr/local/bin/sguil-sensor/pads_agent.tcl > 12 -r-xr-xr-x 1 root wheel 11662 Dec 6 18:31 > /usr/local/bin/sguil-sensor/pads_agent.tcl The problem is I think that the idiomatic tclsh syntax is to use the #!/bin/sh shebang followed by some compat stuff... which doesn't play nicely with rc's idea of how scripts should look. If instead we use procname, that should work better. http://www.bayofrum.net/~crees/scratch/tclshexample2 Does your tclsh script daemonise? You'll need to use daemon(8) to start it otherwise. Also, you'll have to fiddle with procname; use %%TCLSH%% in a port and put SUB_LIST+= TCLSH=${TCLSH} into the Makefile. (Obviously also change the default to NO as well :) Chris From owner-freebsd-rc@FreeBSD.ORG Thu Dec 6 21:50:34 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 474D5410; Thu, 6 Dec 2012 21:50:34 +0000 (UTC) (envelope-from prvs=680cec957=pschmehl_lists@tx.rr.com) Received: from ip-001.utdallas.edu (ip-001.utdallas.edu [129.110.20.107]) by mx1.freebsd.org (Postfix) with ESMTP id A94308FC13; Thu, 6 Dec 2012 21:50:33 +0000 (UTC) X-Group: None X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYEAPkRwVCBbgogVmdsb2JhbABEFr4vAwEiJieCHgEBBAE4Aj8FCwsOCi5DFAYTiAoGDMJijDmDYmEDiF+gfQ X-IronPort-AV: E=Sophos;i="4.84,233,1355119200"; d="scan'208";a="113935053" Received: from zxtm01.utdallas.edu (HELO utd71538.utdallas.edu) ([129.110.10.32]) by ip-001.utdallas.edu with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Dec 2012 15:50:31 -0600 Date: Thu, 06 Dec 2012 15:50:30 -0600 From: Paul Schmehl To: Chris Rees Subject: Re: rc.subr questions Message-ID: <42524AACF8B3EE83929D0673@utd71538.campus.ad.utdallas.edu> In-Reply-To: References: <0FC50D96AC60C2D7BEFC786A@utd71538.campus.ad.utdallas.edu> X-Mailer: Mulberry/4.1.0a1 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline; size=4090 Cc: freebsd-rc@freebsd.org, FreeBSD Ports List X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Paul Schmehl 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 21:50:34 -0000 --On December 6, 2012 9:30:04 PM +0000 Chris Rees wrote: > On 6 December 2012 21:10, Paul Schmehl wrote: >> --On December 6, 2012 8:45:50 PM +0000 Chris Rees >> wrote: >> >>> [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 >> >> >> It is. >> >> >> , put a shebang in; #!/usr/bin/env tclsh >> >> Here's the current script's starting lines: >> >> # !/bin/sh >> # Run tcl from users PATH \ >> exec tclsh "$0" "$@" >>> >>> >>> # !/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 >>> >> >> Here's the rc script I'm working on. >> >> . /etc/rc.subr >> >> load_rc_config pads_agent >> >> # set defaults >> pads_agent_enable=${pads_agent_enable:-"NO"} >> pads_agent_conf=${pads_agent_conf:-"/usr/local/etc/sguil-sensor/pads_age >> nt.conf"} pads_agent_flags="${pads_agent_flags}:-"-D -c >> ${pads_agent_conf}" >> >> name="pads_agent" >> rcvar=pads_agent_enable >> >> command="/usr/local/bin/sguil-sensor/pads_agent.tcl" >> command_interpreter="tclsh" >> command_args=${pads_agent_flags} >> >> run_rc_command "$@" >> >> Here's the error I'm getting when I run start: >> >> /usr/local/etc/rc.d/pads_agent: WARNING: $command_interpreter tclsh != >> /bin/sh >> Starting pads_agent. >> /usr/local/etc/rc.d/pads_agent: WARNING: $command_interpreter tclsh != >> /bin/sh >> /usr/local/etc/rc.d/pads_agent: unknown directive >> '/usr/local/bin/sguil-sensor/pads_agent.tcl'. >> Usage: /usr/local/etc/rc.d/pads_agent >> [fast|force|one|quiet](start|stop|restart|rcvar|status|poll) >> /usr/local/etc/rc.d/pads_agent: WARNING: failed to start pads_agent >> >> I tried changing the interpreter to "/bin/sh" but I got the same error. >> >> Here's the perms on the script: >> >> # ls -lsa /usr/local/bin/sguil-sensor/pads_agent.tcl >> 12 -r-xr-xr-x 1 root wheel 11662 Dec 6 18:31 >> /usr/local/bin/sguil-sensor/pads_agent.tcl > > The problem is I think that the idiomatic tclsh syntax is to use the ># !/bin/sh shebang followed by some compat stuff... which doesn't play > nicely with rc's idea of how scripts should look. > > If instead we use procname, that should work better. > > http://www.bayofrum.net/~crees/scratch/tclshexample2 > > Does your tclsh script daemonise? It's supposed to, but it fails. Let's cease this discussion for now while I do some troubleshooting. I think I have bigger problems than just the rc.subr stuff, and I don't want to waste any more of your time. -- Paul Schmehl, Senior Infosec Analyst As if it wasn't already obvious, my opinions are my own and not those of my employer. ******************************************* "It is as useless to argue with those who have renounced the use of reason as to administer medication to the dead." Thomas Jefferson "There are some ideas so wrong that only a very intelligent person could believe in them." George Orwell From owner-freebsd-rc@FreeBSD.ORG Fri Dec 7 07:20:30 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 AF5B2AA1; Fri, 7 Dec 2012 07:20:30 +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 04C028FC0C; Fri, 7 Dec 2012 07:20:29 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so71122bkc.13 for ; Thu, 06 Dec 2012 23:20:28 -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=vP6yrZrfvckIR1zkb6RlONPIMdNdd/wn1B2WoLrgtYY=; b=EWnHxm3YoTMTNUcRmE8FAcQ94XR/40N+e2MIT+wVWznTr+S6xG0CrlP8YCZxqFeOZU dgmyusBf7gpXe2LZNBB6me+rf663kpgFlIcvu4KciaeqSjxggwGvnxfQuaV5M3LntVHA 8HFB1J/6msvIPqoqY2lHZ4XyU73xQi6nJQrEMPSsFNG3/9uLgO0lcs/yjzNB1MeEGAg7 kmYvW4HeyQHKeGYPYSttDz5H3D3fgHyNPMe4udpUqsP2/svPSpYoF7d6sxnWONVTXT/+ f9i7n0tv33iS9DN7xovAGorExX3WL4jdqui1TQhnRblFiO4NjOOwnzks/3VUyMzGoRsH 3pFw== Received: by 10.204.130.140 with SMTP id t12mr1630086bks.39.1354864828696; Thu, 06 Dec 2012 23:20:28 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.204.167.71 with HTTP; Thu, 6 Dec 2012 23:19:58 -0800 (PST) In-Reply-To: <42524AACF8B3EE83929D0673@utd71538.campus.ad.utdallas.edu> References: <0FC50D96AC60C2D7BEFC786A@utd71538.campus.ad.utdallas.edu> <42524AACF8B3EE83929D0673@utd71538.campus.ad.utdallas.edu> From: Chris Rees Date: Fri, 7 Dec 2012 07:19:58 +0000 X-Google-Sender-Auth: ARso9eKawRTRsHyOBlDXAN-ZMbE Message-ID: Subject: Re: rc.subr questions To: Paul Schmehl Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-rc@freebsd.org" , 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: Fri, 07 Dec 2012 07:20:30 -0000 On 6 December 2012 21:50, Paul Schmehl wrote: > --On December 6, 2012 9:30:04 PM +0000 Chris Rees wrote: > >> On 6 December 2012 21:10, Paul Schmehl wrote: >>> >>> --On December 6, 2012 8:45:50 PM +0000 Chris Rees >>> wrote: >>> >>>> [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 >>> >>> >>> >>> It is. >>> >>> >>> , put a shebang in; #!/usr/bin/env tclsh >>> >>> Here's the current script's starting lines: >>> >>> # !/bin/sh >>> # Run tcl from users PATH \ >>> exec tclsh "$0" "$@" >>>> >>>> >>>> >>>> # !/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 >>>> >>> >>> Here's the rc script I'm working on. >>> >>> . /etc/rc.subr >>> >>> load_rc_config pads_agent >>> >>> # set defaults >>> >>> pads_agent_enable=${pads_agent_enable:-"NO"} >>> pads_agent_conf=${pads_agent_conf:-"/usr/local/etc/sguil-sensor/pads_age >>> nt.conf"} pads_agent_flags="${pads_agent_flags}:-"-D -c >>> ${pads_agent_conf}" >>> >>> name="pads_agent" >>> rcvar=pads_agent_enable >>> >>> command="/usr/local/bin/sguil-sensor/pads_agent.tcl" >>> command_interpreter="tclsh" >>> command_args=${pads_agent_flags} >>> >>> run_rc_command "$@" >>> >>> Here's the error I'm getting when I run start: >>> >>> /usr/local/etc/rc.d/pads_agent: WARNING: $command_interpreter tclsh != >>> /bin/sh >>> Starting pads_agent. >>> /usr/local/etc/rc.d/pads_agent: WARNING: $command_interpreter tclsh != >>> /bin/sh >>> /usr/local/etc/rc.d/pads_agent: unknown directive >>> '/usr/local/bin/sguil-sensor/pads_agent.tcl'. >>> Usage: /usr/local/etc/rc.d/pads_agent >>> [fast|force|one|quiet](start|stop|restart|rcvar|status|poll) >>> /usr/local/etc/rc.d/pads_agent: WARNING: failed to start pads_agent >>> >>> I tried changing the interpreter to "/bin/sh" but I got the same error. >>> >>> Here's the perms on the script: >>> >>> # ls -lsa /usr/local/bin/sguil-sensor/pads_agent.tcl >>> 12 -r-xr-xr-x 1 root wheel 11662 Dec 6 18:31 >>> /usr/local/bin/sguil-sensor/pads_agent.tcl >> >> >> The problem is I think that the idiomatic tclsh syntax is to use the >> # !/bin/sh shebang followed by some compat stuff... which doesn't play >> >> nicely with rc's idea of how scripts should look. >> >> If instead we use procname, that should work better. >> >> http://www.bayofrum.net/~crees/scratch/tclshexample2 >> >> Does your tclsh script daemonise? > > > It's supposed to, but it fails. Let's cease this discussion for now while I > do some troubleshooting. I think I have bigger problems than just the > rc.subr stuff, and I don't want to waste any more of your time. > I hope you manage to fix it. When you have, I'm happy to continue helping you with the rc script. Good luck, Chris