From: Vincent Danen <vdanen@annvix.org>
Cc: John Nielsen <knoglen@tele2.fr>, <supervision@list.skarnet.org>
Subject: Re: supervising autofs (was Re: kdm not working in run script - SOLVED!!)
Date: Mon, 4 Oct 2004 13:01:05 -0600 [thread overview]
Message-ID: <BE057434-1637-11D9-B06E-000A9598BFB2@annvix.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0410031304180.27752-100000@e-smith.charlieb.ott.istop.com>
[-- Attachment #1: Type: text/plain, Size: 2276 bytes --]
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}
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]
prev parent reply other threads:[~2004-10-04 19:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-30 17:21 kdm not working in run script John Nielsen
2004-09-30 19:34 ` kdm not working in run script - SOLVED!! John Nielsen
2004-09-30 19:41 ` Paul Jarc
2004-10-01 19:24 ` John Nielsen
2004-10-01 19:27 ` John Nielsen
2004-10-01 19:31 ` Charlie Brady
2004-10-01 20:12 ` John Nielsen
2004-10-03 2:29 ` Vincent Danen
2004-10-03 17:05 ` supervising autofs (was Re: kdm not working in run script - SOLVED!!) Charlie Brady
2004-10-04 19:01 ` Vincent Danen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BE057434-1637-11D9-B06E-000A9598BFB2@annvix.org \
--to=vdanen@annvix.org \
--cc=knoglen@tele2.fr \
--cc=supervision@list.skarnet.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).