* [PATCH] 5.0.0_beta1: uncomment "-f --foreground..." help text; comment out unused stuff.
@ 2007-09-26 9:48 Denys Vlasenko
2007-09-26 9:51 ` [PATCH] 5.0.0_beta1: add "-s --stderr" option Denys Vlasenko
2007-09-26 15:08 ` [PATCH] 5.0.0_beta1: uncomment "-f --foreground..." help text; comment out unused stuff Ian Kent
0 siblings, 2 replies; 3+ messages in thread
From: Denys Vlasenko @ 2007-09-26 9:48 UTC (permalink / raw)
To: Ian Kent; +Cc: autofs
[-- Attachment #1: Type: text/plain, Size: 71 bytes --]
Hi Ian,
Please apply attached trivial patch. It is run-tested.
--
vda
[-- Attachment #2: autofs-5.0.0_beta1-fg.patch --]
[-- Type: text/x-diff, Size: 1736 bytes --]
diff -d -urpN autofs-5.0.0_beta1/daemon/automount.c autofs-5.0.0_beta1-fg/daemon/automount.c
--- autofs-5.0.0_beta1/daemon/automount.c 2006-05-02 08:37:35.000000000 +0100
+++ autofs-5.0.0_beta1-fg/daemon/automount.c 2007-09-26 10:27:30.000000000 +0100
@@ -413,6 +413,7 @@ int count_mounts(struct autofs_point *ap
return counter.count;
}
+/* UNUSED
static void check_rm_dirs(struct autofs_point *ap, const char *path, int incl)
{
if ((!ap->ghost) ||
@@ -423,6 +424,7 @@ static void check_rm_dirs(struct autofs_
else if (ap->ghost && (ap->type == LKP_INDIRECT))
rm_unwanted(path, 0, ap->dev);
}
+*/
/* umount all filesystems mounted under path. If incl is true, then
it also tries to umount path itself */
@@ -717,6 +719,7 @@ static int handle_packet(struct autofs_p
return -1;
}
+
static void become_daemon(unsigned foreground)
{
FILE *pidfp;
@@ -1278,7 +1281,7 @@ static void usage(void)
" -t --timeout n auto-unmount in n seconds (0-disable)\n"
" -v --verbose be verbose\n"
" -d --debug log debuging info\n"
- /*" -f --foreground do not fork into background\n" */
+ " -f --foreground do not fork into background\n"
" -V --version print version and exit\n"
, program);
}
diff -d -urpN autofs-5.0.0_beta1/daemon/direct.c autofs-5.0.0_beta1-fg/daemon/direct.c
--- autofs-5.0.0_beta1/daemon/direct.c 2006-05-02 08:37:35.000000000 +0100
+++ autofs-5.0.0_beta1-fg/daemon/direct.c 2007-09-26 10:24:17.000000000 +0100
@@ -213,7 +213,8 @@ int umount_autofs_direct(struct autofs_p
static int unlink_mount_tree(struct list_head *list, const char *mount)
{
struct list_head *p;
- int rv, ret, need_umount;
+ int rv, ret;
+/* int need_umount; */
pid_t pgrp = getpgrp();
char spgrp[10];
/*
[-- Attachment #3: Type: text/plain, Size: 140 bytes --]
_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] 5.0.0_beta1: add "-s --stderr" option
2007-09-26 9:48 [PATCH] 5.0.0_beta1: uncomment "-f --foreground..." help text; comment out unused stuff Denys Vlasenko
@ 2007-09-26 9:51 ` Denys Vlasenko
2007-09-26 15:08 ` [PATCH] 5.0.0_beta1: uncomment "-f --foreground..." help text; comment out unused stuff Ian Kent
1 sibling, 0 replies; 3+ messages in thread
From: Denys Vlasenko @ 2007-09-26 9:51 UTC (permalink / raw)
To: Ian Kent; +Cc: autofs
[-- Attachment #1: Type: text/plain, Size: 237 bytes --]
Hi Ian,
I see that almost everything is in place for this to work, only
actual option handling is missing.
I added it and it works (run-tested).
Please apply attached patch
(should apply on top of autofs-5.0.0_beta1-fg.patch).
--
vda
[-- Attachment #2: autofs-5.0.0_beta1-stderr.patch --]
[-- Type: text/x-diff, Size: 1572 bytes --]
diff -d -urpN autofs-5.0.0_beta1-fg/daemon/automount.c autofs-5.0.0_beta1-stderr/daemon/automount.c
--- autofs-5.0.0_beta1-fg/daemon/automount.c 2007-09-26 10:27:30.000000000 +0100
+++ autofs-5.0.0_beta1-stderr/daemon/automount.c 2007-09-26 10:24:17.000000000 +0100
@@ -719,12 +719,12 @@ static int handle_packet(struct autofs_p
return -1;
}
+static unsigned char to_stderr;
static void become_daemon(unsigned foreground)
{
FILE *pidfp;
char buf[MAX_ERR_BUF];
- unsigned to_stderr = 0;
pid_t pid;
/* Don't BUSY any directories unnecessarily */
@@ -1282,6 +1282,7 @@ static void usage(void)
" -v --verbose be verbose\n"
" -d --debug log debuging info\n"
" -f --foreground do not fork into background\n"
+ " -s --stderr log to stderr instead of syslog\n"
" -V --version print version and exit\n"
, program);
}
@@ -1302,6 +1303,7 @@ int main(int argc, char *argv[])
{"verbose", 0, 0, 'v'},
{"debug", 0, 0, 'd'},
{"foreground", 0, 0, 'f'},
+ {"stderr", 0, 0, 's'},
{"version", 0, 0, 'V'},
{0, 0, 0, 0}
};
@@ -1318,7 +1320,7 @@ int main(int argc, char *argv[])
foreground = 0;
opterr = 0;
- while ((opt = getopt_long(argc, argv, "+hp:t:vdfV", long_options, NULL)) != EOF) {
+ while ((opt = getopt_long(argc, argv, "+hp:t:vdfsV", long_options, NULL)) != EOF) {
switch (opt) {
case 'h':
usage();
@@ -1344,6 +1346,10 @@ int main(int argc, char *argv[])
foreground = 1;
break;
+ case 's':
+ to_stderr = 1;
+ break;
+
case 'V':
printf("Linux automount version %s\n", version);
exit(0);
[-- Attachment #3: Type: text/plain, Size: 140 bytes --]
_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] 5.0.0_beta1: uncomment "-f --foreground..." help text; comment out unused stuff.
2007-09-26 9:48 [PATCH] 5.0.0_beta1: uncomment "-f --foreground..." help text; comment out unused stuff Denys Vlasenko
2007-09-26 9:51 ` [PATCH] 5.0.0_beta1: add "-s --stderr" option Denys Vlasenko
@ 2007-09-26 15:08 ` Ian Kent
1 sibling, 0 replies; 3+ messages in thread
From: Ian Kent @ 2007-09-26 15:08 UTC (permalink / raw)
To: Denys Vlasenko; +Cc: autofs
On Wed, 2007-09-26 at 10:48 +0100, Denys Vlasenko wrote:
> Hi Ian,
>
> Please apply attached trivial patch. It is run-tested.
Sorry I'm so late with this Denys but please look at commit
http://git.kernel.org/?p=linux/storage/autofs/autofs.git;a=commitdiff;h=4bfe89a5c214859eb07ad1aa7e4481d470a5bb3f
I think this will cover the foreground logging issues you're having.
The patch is also in the usual place on kernel.org.
Ian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-09-26 15:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-26 9:48 [PATCH] 5.0.0_beta1: uncomment "-f --foreground..." help text; comment out unused stuff Denys Vlasenko
2007-09-26 9:51 ` [PATCH] 5.0.0_beta1: add "-s --stderr" option Denys Vlasenko
2007-09-26 15:08 ` [PATCH] 5.0.0_beta1: uncomment "-f --foreground..." help text; comment out unused stuff Ian Kent
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.