From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/597 Path: main.gmane.org!not-for-mail From: Vincent Danen Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: supervising autofs (was Re: kdm not working in run script - SOLVED!!) Date: Mon, 4 Oct 2004 13:01:05 -0600 Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-9-497664548" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1096916503 26821 80.91.229.6 (4 Oct 2004 19:01:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Oct 2004 19:01:43 +0000 (UTC) Cc: John Nielsen , Original-X-From: supervision-return-836-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Oct 04 21:01:18 2004 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14] ident=qmailr) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1CEY5G-0003hK-00 for ; Mon, 04 Oct 2004 21:01:18 +0200 Original-Received: (qmail 600 invoked by uid 76); 4 Oct 2004 19:01:34 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 594 invoked from network); 4 Oct 2004 19:01:34 -0000 In-Reply-To: Original-To: Charlie Brady X-Pgp-Agent: GPGMail 1.0.2 X-Mailer: Apple Mail (2.619) X-SA-Exim-Connect-IP: 68.149.59.147 X-SA-Exim-Mail-From: vdanen@annvix.org X-SA-Exim-Version: 4.1 (built Mon, 20 Sep 2004 22:38:34 -0600) X-SA-Exim-Scanned: Yes (on hades.annvix.org) Xref: main.gmane.org gmane.comp.sysutils.supervision.general:597 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:597 --Apple-Mail-9-497664548 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 3-Oct-04, at 11:05 AM, Charlie Brady wrote: > > On Sat, 2 Oct 2004, Vincent Danen wrote: > >> Annvix uses runit... I'm not aware of any others that do, but Annvix >> uses it completely out of the box. The only service that is not run >> under runit is autofs, which I still have to figure out. > > I think this patch (untested) will give you the -f option you need: Yeah, you sent me that a while ago (and I still have to try it although now I'm trying to nail down some mysql and ldap issues). I really need to get this applied and try to convert a really nasty initscript to a run script (this patch is likely the easiest part). > --- autofs-4.0.0pre10/daemon/automount.c.orig 2004-08-22 > 19:40:30.000000000 -0400 > +++ autofs-4.0.0pre10/daemon/automount.c 2004-08-22 20:03:44.000000000 > -0400 > @@ -1143,7 +1143,7 @@ > return -1; > } > > -static void become_daemon(void) > +static void become_daemon(int foreground) > { > FILE *pidfp; > pid_t pid; > @@ -1153,7 +1153,7 @@ > chdir("/"); > > /* Detach from foreground process */ > - if ( !submount ) { > + if ( !submount && !foreground) { > pid = fork(); > if ( pid > 0 ) > exit(0); > @@ -1248,6 +1248,7 @@ > const char **mapargv; > struct sigaction sa; > int mapargc, opt; > + int foreground = 0; > static const struct option long_options[] = { > {"help", 0, 0, 'h'}, > {"pid-file", 1, 0, 'p'}, > @@ -1263,12 +1264,15 @@ > ap.exp_timeout = DEFAULT_TIMEOUT; > > opterr = 0; > - while ( (opt = getopt_long(argc, argv, "+hp:t:v", long_options, > + while ( (opt = getopt_long(argc, argv, "+hp:t:v:f", long_options, > NULL)) != EOF ) { > switch( opt ) { > case 'h': > usage(); > exit(0); > + case 'f': > + foreground++; > + break; > case 'p': > pid_file = optarg; > break; > @@ -1299,7 +1303,7 @@ > exit(1); > } > > - become_daemon(); > + become_daemon(foreground); > > path = argv[0]; > map = argv[1]; > > -- Annvix - Secure Linux Server: http://annvix.org/ *Please note gpg keyid FE6F2AFD has been replaced with keyid FEE30AD4* "lynx -source http://linsec.ca/vdanen.asc | gpg --import" {FEE30AD4 : 7F6C A60C 06C2 4811 FA1C A2BC 2EBC 5E32 FEE3 0AD4} --Apple-Mail-9-497664548 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFBYZ3wLrxeMv7jCtQRAgJYAJ9cUU5cEQkkSrQdnsJ2yxKfmIVxRwCfQDFp 4sqjJPKluna0VvdeLmc1+1w= =/iPF -----END PGP SIGNATURE----- --Apple-Mail-9-497664548--