From 603968934423041757e9e4cf75419b184cec1698 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 5 Mar 2013 14:40:18 +0000 Subject: [PATCH] guestmount: Add --no-fork flag. This prevent guestmount from daemonizing. --- fuse/guestmount.c | 4 ++++ fuse/guestmount.pod | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fuse/guestmount.c b/fuse/guestmount.c index 20f10b7dd..e11a99a6a 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -118,6 +118,7 @@ usage (int status) " --keys-from-stdin Read passphrases from stdin\n" " --live Connect to a live virtual machine\n" " -m|--mount dev[:mnt[:opts]] Mount dev on mnt (if omitted, /)\n" + " --no-fork Don't daemonize\n" " -n|--no-sync Don't autosync\n" " -o|--option opt Pass extra option to FUSE\n" " --pid-file filename Write PID to filename\n" @@ -161,6 +162,7 @@ main (int argc, char *argv[]) { "keys-from-stdin", 0, 0, 0 }, { "live", 0, 0, 0 }, { "mount", 1, 0, 'm' }, + { "no-fork", 0, 0, 0 }, { "no-sync", 0, 0, 'n' }, { "option", 1, 0, 'o' }, { "pid-file", 1, 0, 0 }, @@ -234,6 +236,8 @@ main (int argc, char *argv[]) live = 1; } else if (STREQ (long_options[option_index].name, "pid-file")) { pid_file = optarg; + } else if (STREQ (long_options[option_index].name, "no-fork")) { + do_fork = 0; } else { fprintf (stderr, _("%s: unknown long option: %s (%d)\n"), program_name, long_options[option_index].name, option_index); diff --git a/fuse/guestmount.pod b/fuse/guestmount.pod index 37c85eb8a..8cd04e564 100644 --- a/fuse/guestmount.pod +++ b/fuse/guestmount.pod @@ -268,6 +268,10 @@ filesystem can support them: -m /dev/sda1:/:acl,user_xattr +=item B<--no-fork> + +Don't daemonize (or fork into the background). + =item B<-n> =item B<--no-sync> @@ -363,7 +367,8 @@ See L. Trace libguestfs calls and entry into each FUSE function. -This also stops the daemon from forking into the background. +This also stops the daemon from forking into the background +(see I<--no-fork>). =back