From: Chris Leech <cleech-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
systemd-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: agrover-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
Chris Leech <cleech-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [RFC] iscsid: add --initrd option to set run from initrd hint for systemd
Date: Mon, 10 Dec 2012 14:08:33 -0800 [thread overview]
Message-ID: <1355177316-25803-2-git-send-email-cleech@redhat.com> (raw)
In-Reply-To: <1355177316-25803-1-git-send-email-cleech-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
See http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons
---
usr/iscsid.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/usr/iscsid.c b/usr/iscsid.c
index b4bb65b..7d71085 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -61,6 +61,7 @@ static pid_t log_pid;
static gid_t gid;
static int daemonize = 1;
static int mgmt_ipc_fd;
+static int initrd = 0;
static struct option const long_options[] = {
{"config", required_argument, NULL, 'c'},
@@ -73,6 +74,7 @@ static struct option const long_options[] = {
{"pid", required_argument, NULL, 'p'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'v'},
+ {"initrd", no_argument, &initrd, 1},
{NULL, 0, NULL, 0},
};
@@ -95,6 +97,7 @@ Open-iSCSI initiator daemon.\n\
-p, --pid=pidfile use pid file (default " PID_FILE ").\n\
-h, --help display this help and exit\n\
-v, --version display version and exit\n\
+ --initrd run from initrd\n\
");
}
exit(status);
@@ -383,12 +386,17 @@ int main(int argc, char *argv[])
case 'h':
usage(0);
break;
+ case 0:
+ break;
default:
usage(1);
break;
}
}
+ if (initrd)
+ argv[0][0] = '@';
+
/* initialize logger */
log_pid = log_init(program_name, DEFAULT_AREA_SIZE,
daemonize ? log_do_log_daemon : log_do_log_std, NULL);
--
1.7.11.7
next prev parent reply other threads:[~2012-12-10 22:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-10 22:08 [RFC] iscsid / systemd / dracut integration effort Chris Leech
[not found] ` <1355177316-25803-1-git-send-email-cleech-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-12-10 22:08 ` Chris Leech [this message]
2012-12-10 22:08 ` [RFC] iscsiadm, iscsid: newroot command to survive switch_root Chris Leech
2012-12-10 22:08 ` [RFC] iscsi unit files and helper script Chris Leech
[not found] ` <1355177316-25803-4-git-send-email-cleech-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-12-11 21:47 ` Mike Christie
[not found] ` <50C7A9D7.8080900-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2012-12-11 22:43 ` Chris Leech
2012-12-10 22:08 ` [RFC] dracut iscsi module: early attempt to launch iscsid from the initramfs Chris Leech
2012-12-10 23:56 ` [systemd-devel] [RFC] iscsid / systemd / dracut integration effort "Jóhann B. Guðmundsson"
[not found] ` <50C67697.7020208-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-11 23:26 ` Chris Leech
[not found] ` <20121211232646.GC5307-r8IHplWLGbA5tHQWs+pTeqPFFGjUI2lm2LY78lusg7I@public.gmane.org>
2012-12-12 0:46 ` "Jóhann B. Guðmundsson"
2012-12-12 20:45 ` Tomasz Torcz
[not found] ` <20121212204545.GA23313-bmXekecGUa3k6X4NQihNpw@public.gmane.org>
2012-12-13 0:45 ` Andy Grover
2013-09-23 17:33 ` The Lee-Man
[not found] ` <b993ef26-ea4e-4dbe-8d9a-d86ad50c9fbc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2013-09-23 17:40 ` The Lee-Man
2013-10-01 2:24 ` Lennart Poettering
2012-12-14 19:01 ` Mike Christie
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=1355177316-25803-2-git-send-email-cleech@redhat.com \
--to=cleech-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=agrover-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=systemd-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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