mkinitrd unification across distributions
 help / color / mirror / Atom feed
From: "\"Jóhann B. Guðmundsson\"" <johannbg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Chris Leech <cleech-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	systemd-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	agrover-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [systemd-devel] [RFC] iscsid / systemd / dracut integration effort
Date: Mon, 10 Dec 2012 23:56:07 +0000	[thread overview]
Message-ID: <50C67697.7020208@gmail.com> (raw)
In-Reply-To: <1355177316-25803-1-git-send-email-cleech-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On 12/10/2012 10:08 PM, Chris Leech wrote:
> Sorry about the cross-posting, but I think that in order to get this right I'm
> going to need as much feedback as I can get.
>
> I think I've got this working pretty well now (at least for my iBFT configured
> iSCSI root test case), although the dracut module still needs work.  This is
> based on the iscsid socket activation patch from Tomasz Torcz and the unit
> files from Tomasz and Jóhann B. Guðmundsson.
>
> Attempting to start iscsid using systemd unit files (socket activated or not)
> was impacting my iscsi-root test setup.  Rather than try to preserve the old
> logic that used the _netdev mount flag to determine when iscsid could be safely
> shutdown, I've been working on following the guidelines for root storage
> daemons http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons.
>
> 1) I patched iscsid to set argv[0][0] = '@' if a new --initrd flag is passed on
>     the command line.  It's simple, it works, we don't kill iscsid before the
>     root filesystem is unmounted.
>
> 2) When starting iscsid from the initrd, I then ran into issues of iscsid not
>     functioning properly after the switch_root.  It's not mentioned in the
>     RootStorageDaemons documentation, but if a process left running from the
>     initrd needs further filesystem access at runtime it will need to be able to
>     chroot itself before the switch_root.  I patched iscsid and iscsiadm with a
>     newroot command (using plymouth as an example), and used a dracut clenaup
>     hook to call "iscsiadm --newroot /sysroot".
>
> 3) Related to #2, launching iscsid as a Type=simple service from the initrd
>     (I'm testing this with Fedora 18 beta, where dracut uses systemd in the
>     initrd) results in STDOUT/STDERR access after the switch_root failing with
>     EPIPE.  It seems that the connection to the journal process is dead once the
>     initrd instantiated systemd-journald is replaced with the runtime process.
>
>     I can at least keep iscsid functioning if I run it as Type=forking, but I'm
>     not sure if I'm losing runtime logging or not.  I may be able to do
>     something with the StandardOutput and StandardError options in the service
>     file.

You should be using Type=forking here

>
> 4) None of this helps if the sessions are shutdown when we still need them.
>     Rather than the all-or-nothing _netdev mount option checks that have been
>     used in the past, I'm attempting to use the fact that iscsiadm will skip
>     over session that match a node with startup=onboot set when doing a
>     logoutall.  The iscsi_mark_root_nodes script is borrowed from the SUSE init
>     scripts in the open-iscsi repos written by Hannes Reinecke.  I've made minor
>     changes to export the list of sessions activated in the initramfs, and then
>     mark those as onboot when starting iscsi.service.
>
> Things that still need looking into.
>
> 1) Command line configured iSCSI parameters.  If iscsistart is to be fully
>     removed something needs to setup the node from the command line.  Or
>     iscsistart needs to be able to run alongside iscsid.
>
> 2) Proper ordering of the iscsi.service for non-root filesystems.
>
> Any and all feedback and/or help welcome.
>

Looking the unit file for iscsid I do believe I missed this ( basically 
the same as multipath unit ) since you know it's early boot special, 
root and all that ;)

[Unit]

# Before or After lvm2-activation-early.service
DefaultDependencies=no
Conflicts=shutdown.target

[Install]
WantedBy=sysinit.target

JBG

-- 
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To post to this group, send email to open-iscsi-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to open-iscsi+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/open-iscsi?hl=en.


  parent reply	other threads:[~2012-12-10 23:56 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   ` [RFC] iscsid: add --initrd option to set run from initrd hint for systemd Chris Leech
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   ` "Jóhann B. Guðmundsson" [this message]
     [not found]     ` <50C67697.7020208-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-11 23:26       ` [systemd-devel] [RFC] iscsid / systemd / dracut integration effort 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=50C67697.7020208@gmail.com \
    --to=johannbg-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=agrover-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=cleech-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