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}