Re: [systemd-devel] initrd mount wrongly unmounted during bootup

2015-03-12 Thread Aaron_Wright
Andrei Borzenkov  wrote on 03/11/2015 08:44:28 PM:

> From: Andrei Borzenkov 
> To: aaron_wri...@selinc.com
> Cc: systemd-devel@lists.freedesktop.org
> Date: 03/11/2015 08:44 PM
> Subject: Re: [systemd-devel] initrd mount wrongly unmounted during 
bootup
> 
> В Wed, 11 Mar 2015 11:26:52 -0700
> aaron_wri...@selinc.com пишет:
> 
> > I'm working with an embedded device that mounts / and /var in initrd. 
It 
> > then switches root and fires up systemd. Early in the boot, after 
paths 
> > target, /var gets unmounted. I want systemd to not do that, but I 
can't 
> > figure out how to stop it.
> > I would like systemd to leave /var mounted, but still unmount it 
during 
> > shutdown. I would rather not move the mounting of /var out of initrd. 
Is 
> > this possible?
> > I'm trying to use a very stripped down systemd. As minimal as 
possible. 
> 
> Do you use udev in initrd?
> 

No. initrd is a custom script I wrote, and it mounts devtmpfs for its 
devices.

> > I'm using systemd-219. The logs say that var.mount is bound to an 
inactive 
> > unit, and it is stopping too. I assume that is why /var gets 
unmounted, 
> > but I don't know what to do to stop it. There is no /etc/fstab file. 
There 
> > is no var.mount file.
> > I assume I'm either missing something simple, or it is not possible.
> 
> Did you try this commit?
> 
> 
> commit 628c89cc68ab96fce2de7ebba5933725d147aecc
> ...snip...
> 

I was finally able to get /var to stay mounted when I included the 
local-fs.target and local-fs-pre.target units on the device. Apparently 
they are used magically by systemd. I'm not sure why or how, but it does 
finally work, so I'm happy. This leads to my other question about what 
units are required. I'll continue on that discussion on that thread. 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] initrd mount wrongly unmounted during bootup

2015-03-11 Thread Andrei Borzenkov
В Wed, 11 Mar 2015 11:26:52 -0700
aaron_wri...@selinc.com пишет:

> I'm working with an embedded device that mounts / and /var in initrd. It 
> then switches root and fires up systemd. Early in the boot, after paths 
> target, /var gets unmounted. I want systemd to not do that, but I can't 
> figure out how to stop it.
> I would like systemd to leave /var mounted, but still unmount it during 
> shutdown. I would rather not move the mounting of /var out of initrd. Is 
> this possible?
> I'm trying to use a very stripped down systemd. As minimal as possible. 

Do you use udev in initrd?

> I'm using systemd-219. The logs say that var.mount is bound to an inactive 
> unit, and it is stopping too. I assume that is why /var gets unmounted, 
> but I don't know what to do to stop it. There is no /etc/fstab file. There 
> is no var.mount file.
> I assume I'm either missing something simple, or it is not possible.

Did you try this commit?


commit 628c89cc68ab96fce2de7ebba5933725d147aecc
Author: Lennart Poettering 
Date:   Fri Feb 27 21:55:08 2015 +0100

core: rework device state logic

This change introduces a new state "tentative" for device units. Device
units are considered "plugged" when udev announced them, "dead" when
they are not available in the kernel, and "tentative" when they are
referenced in /proc/self/mountinfo or /proc/swaps but not (yet)
announced via udev.

This should fix a race when device nodes (like loop devices) are created
and immediately mounted. Previously, systemd might end up seeing the
mount unit before the device, and would thus pull down the mount because
its BindTo dependency on the device would not be fulfilled.


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] initrd mount wrongly unmounted during bootup

2015-03-11 Thread Aaron_Wright
I'm working with an embedded device that mounts / and /var in initrd. It 
then switches root and fires up systemd. Early in the boot, after paths 
target, /var gets unmounted. I want systemd to not do that, but I can't 
figure out how to stop it.
I would like systemd to leave /var mounted, but still unmount it during 
shutdown. I would rather not move the mounting of /var out of initrd. Is 
this possible?
I'm trying to use a very stripped down systemd. As minimal as possible. 
I'm using systemd-219. The logs say that var.mount is bound to an inactive 
unit, and it is stopping too. I assume that is why /var gets unmounted, 
but I don't know what to do to stop it. There is no /etc/fstab file. There 
is no var.mount file.
I assume I'm either missing something simple, or it is not possible.
# systemctl --all
...
var.mount   loaded 
inactive dead/var
...

# journalctl
...
systemd[1]: Unit var.mount is bound to inactive unit. Stopping, too.
...
systemd[1]: Reached target Paths.
systemd[1]: Starting Paths.
systemd[1]: Unmounting /var...
systemd[1]: Unmounted /var.
systemd[1]: Created slice System Slice.___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel