Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-18 Thread Jan Engelhardt

On Thursday 2013-10-17 22:16, Colin Guthrie wrote:
 Perhaps a dumb question but are you 100% certain that
 systemd-remount-fs.service has been run? I've not seen any debug about
 it so far on this thread:
[lots of prose]

That said, as the tool worked properly, it would seem that *something*
is re-re-mounting it ro again *after* the systemd tool runs... or for
some reason, /etc/fstab is non-existent (or empty) when the systemd tool
is run at boot. I doubt this is the case, but maybe.

If all else fails, compile a kernel and hook a printk into the
(re)mount function to detect who is issuing ro/rw and when.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Kay Sievers
On Thu, Oct 17, 2013 at 4:54 AM, Andrey Borzenkov arvidj...@gmail.com wrote:
 В Thu, 17 Oct 2013 00:07:55 +0200
 Kay Sievers k...@vrfy.org пишет:

  typically the line looks like this
  UUID=b834776d-69d1-49c6-97c1-d6d758a438f0  / ext4 defaults
 
  i doubt that anything smells what none means

 It typically makes not much sense to specify the id of the rootfs in a
 file stored *on* the rootfs.

 You need to store it (default root device) somewhere to pass onto
 initrd. /etc/fstab is as good a place as any other.

Not sure why you want to store the boot loader config in fstab. The
boot loader can't read fstab, and if you want it to *create* the boot
loader config or initrd, fstab is surely not enough information.

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Warpme

On 10/16/13 9:46 PM, Zbigniew Jędrzejewski-Szmek wrote:

On Wed, Oct 16, 2013 at 09:19:43PM +0200, Warpme wrote:

Maybe we should disable [re]mounting / by systemd at all?

All systemd does, is call 'mount -o remount /'. I have no idea how you end
up with a read-only filesystem.

As a work-around, you can add
/etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf with

[Service]
ExecStartPost=mount -o remount,rw /

and/or run systemd in debug mode (add systemd.log_level=debug on the kernel
command line), to see what is going on.

Zbyszek


Adding

/etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf

not helps.

When I enable debugging by adding systemd.log_level=debug I'm receiving tons of 
messages about started/failed journal.
Probably due / being in ro mode.

Is it possible that ro issue is because I'm building systemd with minimal 
enabled features ?

My configure line is following:
 
	--disable-nls \

--disable-gtk-doc \
--disable-gtk-doc-html \
--disable-gtk-doc-pdf \
--enable-introspection=no \
--disable-ima \
--disable-selinux \
--disable-xz \
--disable-tcpwrap \
--disable-pam \
--disable-acl \
--disable-xattr \
--disable-gcrypt \
--disable-audit \
--disable-libcryptsetup \
--disable-qrencode \
--disable-microhttpd \
--disable-binfmt \
--disable-vconsole \
--disable-readahead \
--disable-quotacheck \
--disable-randomseed \
--disable-logind \
--disable-hostnamed \
--disable-timedated \
--disable-localed \
--disable-coredump \
--disable-gudev \
--disable-keymap \
--disable-manpages \
--enable-split-usr \
--without-python \
LIBS=$(DESTDIR)$(libdir)/libcap.so

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Reindl Harald


Am 17.10.2013 14:59, schrieb Warpme:
 On 10/16/13 9:46 PM, Zbigniew Jędrzejewski-Szmek wrote:
 On Wed, Oct 16, 2013 at 09:19:43PM +0200, Warpme wrote:
 Maybe we should disable [re]mounting / by systemd at all?
 All systemd does, is call 'mount -o remount /'. I have no idea how you end
 up with a read-only filesystem.

 As a work-around, you can add
 /etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf with

 [Service]
 ExecStartPost=mount -o remount,rw /

 and/or run systemd in debug mode (add systemd.log_level=debug on the kernel
 command line), to see what is going on.

 Zbyszek

 Adding
 
 /etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf
 
 not helps.
 
 When I enable debugging by adding systemd.log_level=debug I'm receiving tons 
 of messages about started/failed journal.
 Probably due / being in ro mode.
 
 Is it possible that ro issue is because I'm building systemd with minimal 
 enabled features ?

you should not disable configure options like a butcher and at least not from 
start
normally you build software with default options and try what you can remove and
change before things start to break horrible, not the other way

--disable-pam  --disable-acl  --disable-xattr is for sure not smart
adn many of the others are questionable if you are not on a embedded
device

 My configure line is following:
  
 --disable-nls \
 --disable-gtk-doc \
 --disable-gtk-doc-html \
 --disable-gtk-doc-pdf \
 --enable-introspection=no \
 --disable-ima \
 --disable-selinux \
 --disable-xz \
 --disable-tcpwrap \
 --disable-pam \
 --disable-acl \
 --disable-xattr \
 --disable-gcrypt \
 --disable-audit \
 --disable-libcryptsetup \
 --disable-qrencode \
 --disable-microhttpd \
 --disable-binfmt \
 --disable-vconsole \
 --disable-readahead \
 --disable-quotacheck \
 --disable-randomseed \
 --disable-logind \
 --disable-hostnamed \
 --disable-timedated \
 --disable-localed \
 --disable-coredump \
 --disable-gudev \
 --disable-keymap \
 --disable-manpages \
 --enable-split-usr \
 --without-python \
 LIBS=$(DESTDIR)$(libdir)/libcap.so



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Oct 17, 2013 at 02:59:37PM +0200, Warpme wrote:
 On 10/16/13 9:46 PM, Zbigniew Jędrzejewski-Szmek wrote:
 On Wed, Oct 16, 2013 at 09:19:43PM +0200, Warpme wrote:
 Maybe we should disable [re]mounting / by systemd at all?
 All systemd does, is call 'mount -o remount /'. I have no idea how you end
 up with a read-only filesystem.
 
 As a work-around, you can add
 /etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf with
 
 [Service]
 ExecStartPost=mount -o remount,rw /
 
 and/or run systemd in debug mode (add systemd.log_level=debug on the kernel
 command line), to see what is going on.
 
 Zbyszek
 
 Adding
 
 /etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf
 
 not helps.
Hm.

 When I enable debugging by adding systemd.log_level=debug I'm receiving tons 
 of messages about started/failed journal.
 Probably due / being in ro mode.
That's possible. Try removing or renaming /var/log/journal... journald should 
then stay
in /run/log/journal.

 Is it possible that ro issue is because I'm building systemd with minimal 
 enabled features ?

 
 My configure line is following:
...

Those shouldn't matter.

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Colin Guthrie
'Twas brillig, and Warpme at 17/10/13 13:59 did gyre and gimble:
 On 10/16/13 9:46 PM, Zbigniew Jędrzejewski-Szmek wrote:
 On Wed, Oct 16, 2013 at 09:19:43PM +0200, Warpme wrote:
 Maybe we should disable [re]mounting / by systemd at all?
 All systemd does, is call 'mount -o remount /'. I have no idea how you
 end
 up with a read-only filesystem.

 As a work-around, you can add
 /etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf with

 [Service]
 ExecStartPost=mount -o remount,rw /

 and/or run systemd in debug mode (add systemd.log_level=debug on the
 kernel
 command line), to see what is going on.

 Zbyszek

 Adding
 
 /etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf
 
 not helps.

Perhaps a dumb question but are you 100% certain that
systemd-remount-fs.service has been run? I've not seen any debug about
it so far on this thread:

systemctl status systemd-remount-fs.service

Col




-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Warpme

On 10/17/13 4:27 PM, Colin Guthrie wrote:

Perhaps a dumb question but are you 100% certain that
systemd-remount-fs.service has been run? I've not seen any debug about
it so far on this thread:

systemctl status systemd-remount-fs.service

Col




Col,
Console reports Starting Remount Root and Kernel Filesystems...
and next (after some other entries) Started Root and Kernel Filesystems...

Looking on systemctl status systemd-remount-fs.service reports:
Loaded: loaded
Active: active (exited) (with green color)
Exit code=0/SUCCESS

For me this unit looks like started, executed and exited OK.

My general logic is following:
-let assume initrd script leaves / with mode we are not sure (ro or rw)
-with SysV I don't have anywhere else remount command for / to rw - so 
backward logic says script provides / with rw
-now I'm changing last line in script from /sbin/init  to 
/usr/lib/systemd/systemd (script body is in OP of this thread)
-I'm receiving / with ro mode. So logic says that 
/usr/lib/systemd/systemd process changes mode of / from rw to ro


Is there way to tell to systemd not mount/remout / (ideally not touch / 
at all) ?


br

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Colin Guthrie
'Twas brillig, and Warpme at 17/10/13 18:15 did gyre and gimble:
 On 10/17/13 4:27 PM, Colin Guthrie wrote:
 Perhaps a dumb question but are you 100% certain that
 systemd-remount-fs.service has been run? I've not seen any debug about
 it so far on this thread:

 systemctl status systemd-remount-fs.service

 Console reports Starting Remount Root and Kernel Filesystems...

This is the important one

 and next (after some other entries) Started Root and Kernel
 Filesystems...

This one seems different but I guess you maybe just missed the word
Remount in the retyping?

 Looking on systemctl status systemd-remount-fs.service reports:
 Loaded: loaded
 Active: active (exited) (with green color)
 Exit code=0/SUCCESS
 
 For me this unit looks like started, executed and exited OK.

Yup, that looks good.

FWIW, all it does is run a little utility shipped with systemd that
finds / and /usr in /etc/fstab and attempts to remount them.

The utility binary is [/usr]/lib/systemd/systemd-remount-fs

It seems that it ran and exited with 0 which is successful, but I cannot
see how it could do that unless it had trouble parsing the fstab and
just couldn't spot / or /usr.

 My general logic is following:
 -let assume initrd script leaves / with mode we are not sure (ro or rw)
 -with SysV I don't have anywhere else remount command for / to rw 

OK, this did used to be done in (IIRC) rc.sysinit via initscripts
package, but as you say it's not there, I'll take your word for it.

 - so
 backward logic says script provides / with rw
 -now I'm changing last line in script from /sbin/init  to
 /usr/lib/systemd/systemd (script body is in OP of this thread)
 -I'm receiving / with ro mode. So logic says that
 /usr/lib/systemd/systemd process changes mode of / from rw to ro

I can see why you get to this conclusion, but I'd be cautious of
assuming this is how things work!

 Is there way to tell to systemd not mount/remout / (ideally not touch /
 at all) ?

Technically it you can just mask the systemd-remount-fs.service which
will avoid the remounts, but, if I'm honest, I suspect something in your
sysvinit setup *is* doing the remount for you somehow.

Here's what I would suggest:

1. Boot and get a shell where / is ro (i.e. the error state)
2. Run the [/usr]/lib/systemd/systemd-remount-fs manually and see if it
corrects the mount problem.
3. If 2) does NOT solve the problem, run: /bin/mount / -o remount
(including the full path). This is all that the above utility does
internally, so if this fails on it's own, then running it via the
utility cannot fix it.

If 3 works but 2 didn't, then the only way I can see it not doing it's
job, but still exiting successfully, is if it fails to properly parse
your fstab.

Here is the source:
http://cgit.freedesktop.org/systemd/systemd/tree/src/remount-fs/remount-fs.c

Even if you are not too familiar with c, it should be easy to follow.

HTHs

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Warpme

On 10/17/13 7:59 PM, Colin Guthrie wrote:

'Twas brillig, and Warpme at 17/10/13 18:15 did gyre and gimble:

On 10/17/13 4:27 PM, Colin Guthrie wrote:

Perhaps a dumb question but are you 100% certain that
systemd-remount-fs.service has been run? I've not seen any debug about
it so far on this thread:

systemctl status systemd-remount-fs.service

Console reports Starting Remount Root and Kernel Filesystems...

This is the important one


and next (after some other entries) Started Root and Kernel
Filesystems...

This one seems different but I guess you maybe just missed the word
Remount in the retyping?


Looking on systemctl status systemd-remount-fs.service reports:
Loaded: loaded
Active: active (exited) (with green color)
Exit code=0/SUCCESS

For me this unit looks like started, executed and exited OK.

Yup, that looks good.

FWIW, all it does is run a little utility shipped with systemd that
finds / and /usr in /etc/fstab and attempts to remount them.

The utility binary is [/usr]/lib/systemd/systemd-remount-fs

It seems that it ran and exited with 0 which is successful, but I cannot
see how it could do that unless it had trouble parsing the fstab and
just couldn't spot / or /usr.


My general logic is following:
-let assume initrd script leaves / with mode we are not sure (ro or rw)
-with SysV I don't have anywhere else remount command for / to rw

OK, this did used to be done in (IIRC) rc.sysinit via initscripts
package, but as you say it's not there, I'll take your word for it.


- so
backward logic says script provides / with rw
-now I'm changing last line in script from /sbin/init  to
/usr/lib/systemd/systemd (script body is in OP of this thread)
-I'm receiving / with ro mode. So logic says that
/usr/lib/systemd/systemd process changes mode of / from rw to ro

I can see why you get to this conclusion, but I'd be cautious of
assuming this is how things work!


Is there way to tell to systemd not mount/remout / (ideally not touch /
at all) ?

Technically it you can just mask the systemd-remount-fs.service which
will avoid the remounts, but, if I'm honest, I suspect something in your
sysvinit setup *is* doing the remount for you somehow.

Here's what I would suggest:

1. Boot and get a shell where / is ro (i.e. the error state)
2. Run the [/usr]/lib/systemd/systemd-remount-fs manually and see if it
corrects the mount problem.
3. If 2) does NOT solve the problem, run: /bin/mount / -o remount
(including the full path). This is all that the above utility does
internally, so if this fails on it's own, then running it via the
utility cannot fix it.

If 3 works but 2 didn't, then the only way I can see it not doing it's
job, but still exiting successfully, is if it fails to properly parse
your fstab.

Here is the source:
http://cgit.freedesktop.org/systemd/systemd/tree/src/remount-fs/remount-fs.c

Even if you are not too familiar with c, it should be easy to follow.

HTHs

Col



Col,
Many thx for replay.
It looks like we are moving forward:
2 works.
3 always worked.
So now Q is why manual launching /usr/lib/systemd/systemd-remount-fs 
works, and unit with this exec launched by systemd not.

Restarting unit via systemctl restart also fixes problem.

So summarizing:
1.systemd-remount-fs.service status from boot sequence is OK - but / is ro
2.starting /usr/lib/systemd/systemd-remount-fs switches / to rw
3.systemctl restart systemd-remount-fs.service switches / to rw

Console output from 1  3 is the same.
So it looks like:
a\ /usr/lib/systemd/systemd-remount-fs from 1 is not doing its job, or
b\ /usr/lib/systemd/systemd-remount-fs is doing its job but later / 
somehow is switched back to ro.


Maybe issue is within my fstab?
It has:
none/autoremount,rw0 0

br

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-17 Thread Colin Guthrie
'Twas brillig, and Warpme at 17/10/13 20:25 did gyre and gimble:
 On 10/17/13 7:59 PM, Colin Guthrie wrote:
 'Twas brillig, and Warpme at 17/10/13 18:15 did gyre and gimble:
 On 10/17/13 4:27 PM, Colin Guthrie wrote:
 Perhaps a dumb question but are you 100% certain that
 systemd-remount-fs.service has been run? I've not seen any debug about
 it so far on this thread:

 systemctl status systemd-remount-fs.service
 Console reports Starting Remount Root and Kernel Filesystems...
 This is the important one

 and next (after some other entries) Started Root and Kernel
 Filesystems...
 This one seems different but I guess you maybe just missed the word
 Remount in the retyping?

 Looking on systemctl status systemd-remount-fs.service reports:
 Loaded: loaded
 Active: active (exited) (with green color)
 Exit code=0/SUCCESS

 For me this unit looks like started, executed and exited OK.
 Yup, that looks good.

 FWIW, all it does is run a little utility shipped with systemd that
 finds / and /usr in /etc/fstab and attempts to remount them.

 The utility binary is [/usr]/lib/systemd/systemd-remount-fs

 It seems that it ran and exited with 0 which is successful, but I cannot
 see how it could do that unless it had trouble parsing the fstab and
 just couldn't spot / or /usr.

 My general logic is following:
 -let assume initrd script leaves / with mode we are not sure (ro or rw)
 -with SysV I don't have anywhere else remount command for / to rw
 OK, this did used to be done in (IIRC) rc.sysinit via initscripts
 package, but as you say it's not there, I'll take your word for it.

 - so
 backward logic says script provides / with rw
 -now I'm changing last line in script from /sbin/init  to
 /usr/lib/systemd/systemd (script body is in OP of this thread)
 -I'm receiving / with ro mode. So logic says that
 /usr/lib/systemd/systemd process changes mode of / from rw to ro
 I can see why you get to this conclusion, but I'd be cautious of
 assuming this is how things work!

 Is there way to tell to systemd not mount/remout / (ideally not touch /
 at all) ?
 Technically it you can just mask the systemd-remount-fs.service which
 will avoid the remounts, but, if I'm honest, I suspect something in your
 sysvinit setup *is* doing the remount for you somehow.

 Here's what I would suggest:

 1. Boot and get a shell where / is ro (i.e. the error state)
 2. Run the [/usr]/lib/systemd/systemd-remount-fs manually and see if it
 corrects the mount problem.
 3. If 2) does NOT solve the problem, run: /bin/mount / -o remount
 (including the full path). This is all that the above utility does
 internally, so if this fails on it's own, then running it via the
 utility cannot fix it.

 If 3 works but 2 didn't, then the only way I can see it not doing it's
 job, but still exiting successfully, is if it fails to properly parse
 your fstab.

 Here is the source:
 http://cgit.freedesktop.org/systemd/systemd/tree/src/remount-fs/remount-fs.c


 Even if you are not too familiar with c, it should be easy to follow.

 HTHs

 Col


 Col,
 Many thx for replay.
 It looks like we are moving forward:
 2 works.
 3 always worked.
 So now Q is why manual launching /usr/lib/systemd/systemd-remount-fs
 works, and unit with this exec launched by systemd not.
 Restarting unit via systemctl restart also fixes problem.
 
 So summarizing:
 1.systemd-remount-fs.service status from boot sequence is OK - but / is ro
 2.starting /usr/lib/systemd/systemd-remount-fs switches / to rw
 3.systemctl restart systemd-remount-fs.service switches / to rw
 
 Console output from 1  3 is the same.
 So it looks like:
 a\ /usr/lib/systemd/systemd-remount-fs from 1 is not doing its job, or
 b\ /usr/lib/systemd/systemd-remount-fs is doing its job but later /
 somehow is switched back to ro.
 
 Maybe issue is within my fstab?
 It has:
 none/autoremount,rw0 0

IMO, it shouldn't have remount as the option here. I think this is only
something that should be given on the command line.

That said, as the tool worked properly, it would seem that *something*
is re-re-mounting it ro again *after* the systemd tool runs... or for
some reason, /etc/fstab is non-existent (or empty) when the systemd tool
is run at boot. I doubt this is the case, but maybe.

As the tool has various log_debug() calls in it, if you boot with
systemd.log_level=debug, I believe you should see those messages in your
log. If you don't see them, but do see them when you manually run the
tool later, then this points to a problem with the /etc/fstab during
early boot.

HTHs

col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org

Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Oct 16, 2013 at 06:18:12PM +0200, Warpme wrote:
 Hi,
 I want to switch init system from SysV to systemd-196.
 Sys is PXE booted disk-less appliance with rootfs based on overlayfs.
 
 Currently I can PXEboot, successfully switch root from initrd to
 overlayfs based root, systemd starts and executes many of it's
 units.
 Unfortunately user units are failing due / is read-only.
 When I issue mount -o remount,rw /  - root becomes rw - so it
 looks like systemd for some reason isn't remounting root to rw.
 Interesting is that exactly the same initrd-overlayfs script (see
 below) works OK for SysV - so I think issue isn't in my pivot_root
 procedure but rather systemd receives / in rw but leaves in ro (as
 mount -o remount,rw / allows to write to /).
 
 Script switching initrd to overlayfs root looks following:
 
 /bin/mount -n -t tmpfs none /rw
 /bin/mkdir -p /rw/rootfs
 /bin/mount -n -t overlayfs -o
 lowerdir=/rootfs-ro,upperdir=/rw/rootfs none /rootfs
 cd /rootfs
 /bin/mkdir -p initrd proc sys
 /sbin/pivot_root . initrd
 exec /usr/sbin/chroot . /usr/lib/systemd/systemd
 
 Where issue might be?
What's in /etc/fstab?

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Warpme

On 10/16/13 7:02 PM, Zbigniew Jędrzejewski-Szmek wrote:

On Wed, Oct 16, 2013 at 06:18:12PM +0200, Warpme wrote:

Hi,
I want to switch init system from SysV to systemd-196.
Sys is PXE booted disk-less appliance with rootfs based on overlayfs.

Currently I can PXEboot, successfully switch root from initrd to
overlayfs based root, systemd starts and executes many of it's
units.
Unfortunately user units are failing due / is read-only.
When I issue mount -o remount,rw /  - root becomes rw - so it
looks like systemd for some reason isn't remounting root to rw.
Interesting is that exactly the same initrd-overlayfs script (see
below) works OK for SysV - so I think issue isn't in my pivot_root
procedure but rather systemd receives / in rw but leaves in ro (as
mount -o remount,rw / allows to write to /).

Script switching initrd to overlayfs root looks following:

/bin/mount -n -t tmpfs none /rw
/bin/mkdir -p /rw/rootfs
/bin/mount -n -t overlayfs -o
lowerdir=/rootfs-ro,upperdir=/rw/rootfs none /rootfs
cd /rootfs
/bin/mkdir -p initrd proc sys
/sbin/pivot_root . initrd
exec /usr/sbin/chroot . /usr/lib/systemd/systemd

Where issue might be?

What's in /etc/fstab?

Zbyszek


Zbyszku,

Here is my fstab:

none / auto remount,rw 0 0

pzdr

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Reindl Harald


Am 16.10.2013 19:22, schrieb Warpme:
 On 10/16/13 7:02 PM, Zbigniew Jędrzejewski-Szmek wrote:
 On Wed, Oct 16, 2013 at 06:18:12PM +0200, Warpme wrote:
 Hi,
 I want to switch init system from SysV to systemd-196.
 Sys is PXE booted disk-less appliance with rootfs based on overlayfs.

 Currently I can PXEboot, successfully switch root from initrd to
 overlayfs based root, systemd starts and executes many of it's
 units.
 Unfortunately user units are failing due / is read-only.
 When I issue mount -o remount,rw /  - root becomes rw - so it
 looks like systemd for some reason isn't remounting root to rw.
 Interesting is that exactly the same initrd-overlayfs script (see
 below) works OK for SysV - so I think issue isn't in my pivot_root
 procedure but rather systemd receives / in rw but leaves in ro (as
 mount -o remount,rw / allows to write to /).

 Script switching initrd to overlayfs root looks following:

 /bin/mount -n -t tmpfs none /rw
 /bin/mkdir -p /rw/rootfs
 /bin/mount -n -t overlayfs -o
 lowerdir=/rootfs-ro,upperdir=/rw/rootfs none /rootfs
 cd /rootfs
 /bin/mkdir -p initrd proc sys
 /sbin/pivot_root . initrd
 exec /usr/sbin/chroot . /usr/lib/systemd/systemd

 Where issue might be?
 What's in /etc/fstab?

 Zbyszek

 Zbyszku,
 
 Here is my fstab:
 
 none / auto remount,rw 0 0

why none and remount?

typically the line looks like this
UUID=b834776d-69d1-49c6-97c1-d6d758a438f0  / ext4 defaults

i doubt that anything smells what none means




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Oct 16, 2013 at 07:22:28PM +0200, Warpme wrote:
 On 10/16/13 7:02 PM, Zbigniew Jędrzejewski-Szmek wrote:
 On Wed, Oct 16, 2013 at 06:18:12PM +0200, Warpme wrote:
 Hi,
 I want to switch init system from SysV to systemd-196.
 Sys is PXE booted disk-less appliance with rootfs based on overlayfs.
 
 Currently I can PXEboot, successfully switch root from initrd to
 overlayfs based root, systemd starts and executes many of it's
 units.
 Unfortunately user units are failing due / is read-only.
 When I issue mount -o remount,rw /  - root becomes rw - so it
 looks like systemd for some reason isn't remounting root to rw.
 Interesting is that exactly the same initrd-overlayfs script (see
 below) works OK for SysV - so I think issue isn't in my pivot_root
 procedure but rather systemd receives / in rw but leaves in ro (as
 mount -o remount,rw / allows to write to /).
 
 Script switching initrd to overlayfs root looks following:
 
 /bin/mount -n -t tmpfs none /rw
 /bin/mkdir -p /rw/rootfs
 /bin/mount -n -t overlayfs -o
 lowerdir=/rootfs-ro,upperdir=/rw/rootfs none /rootfs
 cd /rootfs
 /bin/mkdir -p initrd proc sys
 /sbin/pivot_root . initrd
 exec /usr/sbin/chroot . /usr/lib/systemd/systemd
 
 Where issue might be?
 What's in /etc/fstab?
 
 Zbyszek
 
 Zbyszku,
 
 Here is my fstab:
 
 none / auto remount,rw 0 0
OK, so fstab-generator will ignore the mount point becuase of the 'none'.
This means that systemd will not remount it.

Actually, I don't understand why / is mounted read-only: -w is the default
for mount, and you don't specify -r anywhere. Maybe it's specific to overlayfs.

I think that your best option is to add

/bin/mount -o remount,rw /

in the script.

The other option — modifying systemd — is also possible, but it won't
happen without a good reason. Your usecase should be trivially solved
by modifying the script, so it's not good enough.

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Warpme

On 10/16/13 7:40 PM, Zbigniew Jędrzejewski-Szmek wrote:

On Wed, Oct 16, 2013 at 07:22:28PM +0200, Warpme wrote:

On 10/16/13 7:02 PM, Zbigniew Jędrzejewski-Szmek wrote:

On Wed, Oct 16, 2013 at 06:18:12PM +0200, Warpme wrote:

Hi,
I want to switch init system from SysV to systemd-196.
Sys is PXE booted disk-less appliance with rootfs based on overlayfs.

Currently I can PXEboot, successfully switch root from initrd to
overlayfs based root, systemd starts and executes many of it's
units.
Unfortunately user units are failing due / is read-only.
When I issue mount -o remount,rw /  - root becomes rw - so it
looks like systemd for some reason isn't remounting root to rw.
Interesting is that exactly the same initrd-overlayfs script (see
below) works OK for SysV - so I think issue isn't in my pivot_root
procedure but rather systemd receives / in rw but leaves in ro (as
mount -o remount,rw / allows to write to /).

Script switching initrd to overlayfs root looks following:

/bin/mount -n -t tmpfs none /rw
/bin/mkdir -p /rw/rootfs
/bin/mount -n -t overlayfs -o
lowerdir=/rootfs-ro,upperdir=/rw/rootfs none /rootfs
cd /rootfs
/bin/mkdir -p initrd proc sys
/sbin/pivot_root . initrd
exec /usr/sbin/chroot . /usr/lib/systemd/systemd

Where issue might be?

What's in /etc/fstab?

Zbyszek


Zbyszku,

Here is my fstab:

none / auto remount,rw 0 0

OK, so fstab-generator will ignore the mount point becuase of the 'none'.
This means that systemd will not remount it.

Actually, I don't understand why / is mounted read-only: -w is the default
for mount, and you don't specify -r anywhere. Maybe it's specific to overlayfs.

I think that your best option is to add

/bin/mount -o remount,rw /

in the script.

The other option — modifying systemd — is also possible, but it won't
happen without a good reason. Your usecase should be trivially solved
by modifying the script, so it's not good enough.

Zbyszek


Zbyszku,
I add remount just after pivot_root. No change.
I don't get one thing: why exactly such script works OK for SysV ?
If it works for SysV - it means script leaves / in rw mode.
So it leaves / in rw mode also for systemd (only difference between SysV 
and systemd is script last line).

So logic say for me that systemd changes / mode to ro. But why?
br

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Oct 16, 2013 at 08:31:02PM +0200, Warpme wrote:
 Zbyszku,
 I add remount just after pivot_root. No change.
 I don't get one thing: why exactly such script works OK for SysV ?
 If it works for SysV - it means script leaves / in rw mode.
 So it leaves / in rw mode also for systemd (only difference between
 SysV and systemd is script last line).
 So logic say for me that systemd changes / mode to ro. But why?
 br
That's strange. Can you show what 'systemctl show /' shows?
And the fragment, which is a file specified by FragmentPath=
in the above output, probably /run/systemd/generator/-.mount ?

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Warpme

On 10/16/13 9:02 PM, Zbigniew Jędrzejewski-Szmek wrote:

On Wed, Oct 16, 2013 at 08:31:02PM +0200, Warpme wrote:

Zbyszku,
I add remount just after pivot_root. No change.
I don't get one thing: why exactly such script works OK for SysV ?
If it works for SysV - it means script leaves / in rw mode.
So it leaves / in rw mode also for systemd (only difference between
SysV and systemd is script last line).
So logic say for me that systemd changes / mode to ro. But why?
br

That's strange. Can you show what 'systemctl show /' shows?
And the fragment, which is a file specified by FragmentPath=
in the above output, probably /run/systemd/generator/-.mount ?

Zbyszek


Pls find output of

'systemctl show /'


Id=-.mount
Names=-.mount
RequiredBy=local-fs.target tmp.mount media.mount 
var-lib-mysql\x2dtemp.mount sys-kernel-config.mount 
systemd-journald.socket systemd-ask-password-wall
Before=local-fs.target tmp.mount media.mount var-lib-mysql\x2dtemp.mount 
sys-kernel-config.mount systemd-journald.socket 
systemd-ask-password-wall.pat

Description=/
LoadState=loaded
ActiveState=active
SubState=mounted
FragmentPath=/run/systemd/generator/-.mount
SourcePath=/etc/fstab
InactiveExitTimestamp=Wed, 2013-10-16 18:30:03 CEST
InactiveExitTimestampMonotonic=2836321
ActiveEnterTimestamp=Wed, 2013-10-16 18:30:03 CEST
ActiveEnterTimestampMonotonic=2836321
ActiveExitTimestampMonotonic=0
InactiveEnterTimestampMonotonic=0
CanStart=no
CanStop=no
CanReload=yes
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=yes
RefuseManualStop=yes
AllowIsolate=no
DefaultDependencies=no
OnFailureIsolate=no
IgnoreOnIsolate=yes
IgnoreOnSnapshot=no
DefaultControlGroup=name=systemd:/system/-.mount
ControlGroup=cpu:/system/-.mount name=systemd:/system/-.mount
NeedDaemonReload=no
JobTimeoutUSec=0
ConditionTimestampMonotonic=0
ConditionResult=no
Where=/
What=none
Options=rw,relatime,rw,lowerdir=/rootfs-ro,upperdir=/rw/rootfs
Type=overlayfs
TimeoutUSec=1min 30s
ControlPID=0
DirectoryMode=0755
Result=success
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=62989
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=62989
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=0
Nice=0
:


File

/run/systemd/generator/-.mount


# Automatically generated by systemd-fstab-generator

[Unit]
SourcePath=/etc/fstab
DefaultDependencies=no
Before=local-fs.target

[Mount]
What=none
Where=/
Type=auto
FsckPassNo=0
Options=remount,rw


Maybe we should disable [re]mounting / by systemd at all?


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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Oct 16, 2013 at 09:19:43PM +0200, Warpme wrote:
 Maybe we should disable [re]mounting / by systemd at all?
All systemd does, is call 'mount -o remount /'. I have no idea how you end
up with a read-only filesystem.

As a work-around, you can add
/etc/systemd/system/systemd-remount-fs.service.d/90-remount.conf with

[Service]
ExecStartPost=mount -o remount,rw /

and/or run systemd in debug mode (add systemd.log_level=debug on the kernel
command line), to see what is going on.

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Kay Sievers
On Wed, Oct 16, 2013 at 7:35 PM, Reindl Harald h.rei...@thelounge.net wrote:

 none / auto remount,rw 0 0

 why none and remount?

none because at the time fstab is read, / is already mounted;
therefore the device already known. Specifying the root device in
fstab is in most cases really pointless and makes stuff just
needlessly inflexible. If no specific device is referenced, the rootfs
(with fstab) can just be moved around without editing fstab.

I usually use ROOT instead of none; doesn't matter, it just should
not start with a / to be a *name* and not a *device*.

 typically the line looks like this
 UUID=b834776d-69d1-49c6-97c1-d6d758a438f0  / ext4 defaults

 i doubt that anything smells what none means

It typically makes not much sense to specify the id of the rootfs in a
file stored *on* the rootfs.

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


Re: [systemd-devel] moving from SysV to systemd - issue with / being ro

2013-10-16 Thread Andrey Borzenkov
В Thu, 17 Oct 2013 00:07:55 +0200
Kay Sievers k...@vrfy.org пишет:

 
  typically the line looks like this
  UUID=b834776d-69d1-49c6-97c1-d6d758a438f0  / ext4 defaults
 
  i doubt that anything smells what none means
 
 It typically makes not much sense to specify the id of the rootfs in a
 file stored *on* the rootfs.
 

You need to store it (default root device) somewhere to pass onto
initrd. /etc/fstab is as good a place as any other.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel