Blame 0144-iscsid-add-initrd-option-to-set-run-from-initrd-hint.patch

6bbb92
From b1799fe84ed94a19bba6bcd7284ce8b038be4ffe Mon Sep 17 00:00:00 2001
6bbb92
From: Chris Leech <cleech@redhat.com>
6bbb92
Date: Mon, 10 Dec 2012 13:20:47 -0800
6bbb92
Subject: iscsid: add --initrd option to set run from initrd hint for systemd
6bbb92
6bbb92
See http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons
6bbb92
6bbb92
Signed-off-by: Chris Leech <cleech@redhat.com>
6bbb92
---
6bbb92
 usr/iscsid.c | 8 ++++++++
6bbb92
 1 file changed, 8 insertions(+)
6bbb92
6bbb92
diff --git a/usr/iscsid.c b/usr/iscsid.c
6bbb92
index b4bb65b..7d71085 100644
6bbb92
--- a/usr/iscsid.c
6bbb92
+++ b/usr/iscsid.c
6bbb92
@@ -61,6 +61,7 @@ static pid_t log_pid;
6bbb92
 static gid_t gid;
6bbb92
 static int daemonize = 1;
6bbb92
 static int mgmt_ipc_fd;
6bbb92
+static int initrd = 0;
6bbb92
 
6bbb92
 static struct option const long_options[] = {
6bbb92
 	{"config", required_argument, NULL, 'c'},
6bbb92
@@ -73,6 +74,7 @@ static struct option const long_options[] = {
6bbb92
 	{"pid", required_argument, NULL, 'p'},
6bbb92
 	{"help", no_argument, NULL, 'h'},
6bbb92
 	{"version", no_argument, NULL, 'v'},
6bbb92
+	{"initrd", no_argument, &initrd, 1},
6bbb92
 	{NULL, 0, NULL, 0},
6bbb92
 };
6bbb92
 
6bbb92
@@ -95,6 +97,7 @@ Open-iSCSI initiator daemon.\n\
6bbb92
   -p, --pid=pidfile       use pid file (default " PID_FILE ").\n\
6bbb92
   -h, --help              display this help and exit\n\
6bbb92
   -v, --version           display version and exit\n\
6bbb92
+  --initrd                run from initrd\n\
6bbb92
 ");
6bbb92
 	}
6bbb92
 	exit(status);
6bbb92
@@ -383,12 +386,17 @@ int main(int argc, char *argv[])
6bbb92
 		case 'h':
6bbb92
 			usage(0);
6bbb92
 			break;
6bbb92
+		case 0:
6bbb92
+			break;
6bbb92
 		default:
6bbb92
 			usage(1);
6bbb92
 			break;
6bbb92
 		}
6bbb92
 	}
6bbb92
 
6bbb92
+	if (initrd)
6bbb92
+		argv[0][0] = '@';
6bbb92
+
6bbb92
 	/* initialize logger */
6bbb92
 	log_pid = log_init(program_name, DEFAULT_AREA_SIZE,
6bbb92
 		      daemonize ? log_do_log_daemon : log_do_log_std, NULL);
6bbb92
-- 
6bbb92
1.7.11.7
6bbb92