Re: [systemd-devel] systemd-shutdown static linking (was: Please proof-read: ...)

2013-07-16 Thread Lennart Poettering
On Tue, 11.06.13 10:07, Umut Tezduyar (u...@tezduyar.com) wrote:

 Hi,
 
 Those 2 lines were added on 89b1d5e0e49d3b3501e5f3aadcad712290bcd9bf and
 the commit log explains why we needed them. / can be treated as special
 case and excluded.

Just for completeness' sake. This was implemented in
602c0e740f8290cc9c4f13f2eb4b23fbbd7a8d2b a while back.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-shutdown static linking (was: Please proof-read: ...)

2013-06-11 Thread Ross Lagerwall
On Mon, Jun 10, 2013 at 08:30:40PM +0200, Lennart Poettering wrote:
 Hmm, this is certainly weird. normally -.mount should not have any such
 conflicts. I really wonder where you got those from... What is the
 contents of /run/systemd/generator/-.mount for you?
 

AFAICT, mount_load_proc_self_mountinfo is called early in the boot
process and it calls mount_add_one for each filesystem in
/proc/self/mounts, including /.
If a unit does not exist already, a new unit is created and
the following lines are called (in mount_add_one):

r = unit_add_dependency_by_name(u, UNIT_BEFORE, SPECIAL_LOCAL_FS_TARGET, NULL, 
true);
if (r  0)
goto fail;

r = unit_add_dependency_by_name(u, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, 
true);
if (r  0)
goto fail;

While it would be easy to make the conflicts line above conditional on
the mount point not being /, I'm not sure how this interacts with
mount_load which fills in a whole bunch of stuff and
mount_add_default_dependencies which adds a conflict with umount.target
so long as the mount point is not /.

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


Re: [systemd-devel] systemd-shutdown static linking (was: Please proof-read: ...)

2013-06-11 Thread Umut Tezduyar
Hi,

Those 2 lines were added on 89b1d5e0e49d3b3501e5f3aadcad712290bcd9bf and
the commit log explains why we needed them. / can be treated as special
case and excluded.

Thanks.


On Tue, Jun 11, 2013 at 9:19 AM, Ross Lagerwall rosslagerw...@gmail.comwrote:

 On Mon, Jun 10, 2013 at 08:30:40PM +0200, Lennart Poettering wrote:
  Hmm, this is certainly weird. normally -.mount should not have any such
  conflicts. I really wonder where you got those from... What is the
  contents of /run/systemd/generator/-.mount for you?
 

 AFAICT, mount_load_proc_self_mountinfo is called early in the boot
 process and it calls mount_add_one for each filesystem in
 /proc/self/mounts, including /.
 If a unit does not exist already, a new unit is created and
 the following lines are called (in mount_add_one):

 r = unit_add_dependency_by_name(u, UNIT_BEFORE, SPECIAL_LOCAL_FS_TARGET,
 NULL, true);
 if (r  0)
 goto fail;

 r = unit_add_dependency_by_name(u, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET,
 NULL, true);
 if (r  0)
 goto fail;

 While it would be easy to make the conflicts line above conditional on
 the mount point not being /, I'm not sure how this interacts with
 mount_load which fills in a whole bunch of stuff and
 mount_add_default_dependencies which adds a conflict with umount.target
 so long as the mount point is not /.

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

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


Re: [systemd-devel] systemd-shutdown static linking

2013-06-11 Thread Colin Guthrie
'Twas brillig, and Ross Lagerwall at 11/06/13 08:19 did gyre and gimble:
 On Mon, Jun 10, 2013 at 08:30:40PM +0200, Lennart Poettering wrote:
 Hmm, this is certainly weird. normally -.mount should not have any such
 conflicts. I really wonder where you got those from... What is the
 contents of /run/systemd/generator/-.mount for you?

 
 AFAICT, mount_load_proc_self_mountinfo is called early in the boot
 process and it calls mount_add_one for each filesystem in
 /proc/self/mounts, including /.
 If a unit does not exist already, a new unit is created and
 the following lines are called (in mount_add_one):
 
 r = unit_add_dependency_by_name(u, UNIT_BEFORE, SPECIAL_LOCAL_FS_TARGET, 
 NULL, true);
 if (r  0)
 goto fail;
 
 r = unit_add_dependency_by_name(u, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, 
 NULL, true);
 if (r  0)
 goto fail;
 
 While it would be easy to make the conflicts line above conditional on
 the mount point not being /, I'm not sure how this interacts with
 mount_load which fills in a whole bunch of stuff and
 mount_add_default_dependencies which adds a conflict with umount.target
 so long as the mount point is not /.

Without reading the code etc., I'm running systemd with that commit
(v204) and I don't get any conflicts for my -.mount unit...

So it seems that code is not run for me for whatever reason.

After a very quick glance at the code, it could just be that the unit
already exists as it's created earlier and thus this bit of the code for
-.mount is simply not run?

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] systemd-shutdown static linking (was: Please proof-read: ...)

2013-06-11 Thread Tom Gundersen
On Tue, Jun 11, 2013 at 10:07 AM, Umut Tezduyar u...@tezduyar.com wrote:
 Those 2 lines were added on 89b1d5e0e49d3b3501e5f3aadcad712290bcd9bf and the
 commit log explains why we needed them. / can be treated as special case
 and excluded.

If so, I guess also /usr and anything marked x-initrd.mount should be excluded.

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


Re: [systemd-devel] systemd-shutdown static linking

2013-06-11 Thread Thomas Bächler
Am 11.06.2013 10:34, schrieb Colin Guthrie:
 Without reading the code etc., I'm running systemd with that commit
 (v204) and I don't get any conflicts for my -.mount unit...
 
 So it seems that code is not run for me for whatever reason.
 
 After a very quick glance at the code, it could just be that the unit
 already exists as it's created earlier and thus this bit of the code for
 -.mount is simply not run?

I think this code is only called when there is no -.mount unit, which
results from a missing entry for / in fstab. It is entirely possible
that Ross didn't add / to his fstab by accident or on purpose.




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] systemd-shutdown static linking

2013-06-11 Thread Tom Gundersen
On Tue, Jun 11, 2013 at 10:59 AM, Thomas Bächler tho...@archlinux.org wrote:
 I think this code is only called when there is no -.mount unit, which
 results from a missing entry for / in fstab. It is entirely possible
 that Ross didn't add / to his fstab by accident or on purpose.

I just want to point out: This is a valid use-case, as there should be
no reason to have an entry in fstab for /, assuming it is being
mounted correctly by the initramfs based on the configuration given on
the kernel commandline.

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


Re: [systemd-devel] systemd-shutdown static linking

2013-06-11 Thread Ross Lagerwall
On Tue, Jun 11, 2013 at 10:59:42AM +0200, Thomas Bächler wrote:
 Am 11.06.2013 10:34, schrieb Colin Guthrie:
  Without reading the code etc., I'm running systemd with that commit
  (v204) and I don't get any conflicts for my -.mount unit...
  
  So it seems that code is not run for me for whatever reason.
  
  After a very quick glance at the code, it could just be that the unit
  already exists as it's created earlier and thus this bit of the code for
  -.mount is simply not run?
 
 I think this code is only called when there is no -.mount unit, which
 results from a missing entry for / in fstab. It is entirely possible
 that Ross didn't add / to his fstab by accident or on purpose.
 

But I do have / in my fstab, it's shown in:
http://lists.freedesktop.org/archives/systemd-devel/2013-June/011297.html

Here is part of systemctl dump:
- Unit -.mount:
Description: /
Instance: n/a
Unit Load State: loaded
Unit Active State: active
Inactive Exit Timestamp: Tue 2013-06-11 08:02:21 BST
Active Enter Timestamp: Tue 2013-06-11 08:02:21 BST
Active Exit Timestamp: n/a
Inactive Enter Timestamp: n/a
GC Check Good: yes
Need Daemon Reload: no
Name: -.mount
Fragment Path: /run/systemd/generator/-.mount
Source Path: /etc/fstab
RequiredBy: local-fs.target
...
Conflicts: umount.target
Before: local-fs.target
...
StopWhenUnneeded: no
RefuseManualStart: yes
RefuseManualStop: yes
DefaultDependencies: no
OnFailureIsolate: no
IgnoreOnIsolate: yes
IgnoreOnSnapshot: no
ControlGroup: cpu:/system/-.mount
ControlGroup: name=systemd:/system/-.mount
Mount State: mounted
Result: success
Where: /
What: /dev/sda2
File System Type: ext4
Options: rw,relatime,rw,data=ordered
From /proc/self/mountinfo: yes
From fragment: yes
DirectoryMode: 0755
UMask: 0022
WorkingDirectory: /
RootDirectory: /
NonBlocking: no
...

It has Source Path as fstab and From /proc/self/mountinfo as yes.

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


Re: [systemd-devel] systemd-shutdown static linking (was: Please proof-read: ...)

2013-06-10 Thread Lennart Poettering
On Sun, 09.06.13 17:11, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:

  And if I run pacman -S glibc and then shutdown:
  -.mount mount process exited, code=exited status=32
  -.mount changed unmounting - mounted
  Job -.mount/stop finished, result=failed
  Failed unmounting /.

This is really weird... (Though unrelated to systemd-shutdown, as this
is generated before we execute it, replacing PID 1).

-.mount is the mount unit is something we do not try to unmount at
shutdown from normal systemd, as that's impossible to do at that
point. The other file systems have a Conflicts=umount.target to get them
unmounted at shutdown, but -.mount explicitly doesn.t 

Ross, how exactly did you shutdown to get this? What does systemctl
show -- -.mount show you? Does it any Conflicts= line?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-shutdown static linking (was: Please proof-read: ...)

2013-06-10 Thread Ross Lagerwall
On Mon, Jun 10, 2013 at 12:33:01PM +0200, Lennart Poettering wrote:
 This is really weird... (Though unrelated to systemd-shutdown, as this
 is generated before we execute it, replacing PID 1).
 
 -.mount is the mount unit is something we do not try to unmount at
 shutdown from normal systemd, as that's impossible to do at that
 point. The other file systems have a Conflicts=umount.target to get them
 unmounted at shutdown, but -.mount explicitly doesn.t 
 
 Ross, how exactly did you shutdown to get this? What does systemctl
 show -- -.mount show you? Does it any Conflicts= line?
 

As root: halt

I have attached the output of systemctl show -- -.mount and /etc/fstab
and /proc/cmdline.

I see that Conflicts=umount.target is set, though I have no idea why.

I haven't changed too much in the setup, at least not related to
mounting.

Regards
-- 
Ross Lagerwall
Id=-.mount
Names=-.mount
RequiredBy=local-fs.target proc-sys-fs-binfmt_misc.mount 
sys-kernel-config.mount dev-mqueue.mount sys-fs-fuse-connections.mount 
dev-hugepages.mount sys-kernel-debug.mount tmp.mount systemd-shutdownd.socket 
systemd-initctl.socket lvmetad.socket dmeventd.socket 
systemd-udevd-control.socket dbus.socket syslog.socket systemd-journald.socket 
systemd-ask-password-wall.path systemd-ask-password-console.path 
systemd-random-seed-load.service systemd-update-utmp.service 
systemd-random-seed-save.service proc-sys-fs-binfmt_misc.automount
Conflicts=umount.target
Before=local-fs.target proc-sys-fs-binfmt_misc.mount sys-kernel-config.mount 
dev-mqueue.mount sys-fs-fuse-connections.mount dev-hugepages.mount 
sys-kernel-debug.mount tmp.mount systemd-shutdownd.socket 
systemd-initctl.socket lvmetad.socket dmeventd.socket 
systemd-udevd-control.socket dbus.socket syslog.socket systemd-journald.socket 
systemd-ask-password-wall.path systemd-ask-password-console.path 
systemd-random-seed-load.service systemd-update-utmp.service 
systemd-random-seed-save.service proc-sys-fs-binfmt_misc.automount
Description=/
LoadState=loaded
ActiveState=active
SubState=mounted
FragmentPath=/run/systemd/generator/-.mount
SourcePath=/etc/fstab
InactiveExitTimestamp=Mon 2013-06-10 13:19:52 BST
InactiveExitTimestampMonotonic=49
ActiveEnterTimestamp=Mon 2013-06-10 13:19:52 BST
ActiveEnterTimestampMonotonic=49
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
NeedDaemonReload=no
JobTimeoutUSec=0
ConditionTimestampMonotonic=0
ConditionResult=no
Where=/
What=/dev/sda1
Options=rw,relatime,rw,data=ordered
Type=ext4
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=16008
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=16008
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=0
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
TimerSlackNSec=5
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=inherit
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SecureBits=0
CapabilityBoundingSet=18446744073709551615
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
SameProcessGroup=yes
ControlGroupModify=no
ControlGroupPersistent=no
IgnoreSIGPIPE=yes
NoNewPrivileges=no
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
DefaultControlGroup=name=systemd:/system/-.mount
ControlGroups=cpu:/system/-.mount name=systemd:/system/-.mount
# 
# /etc/fstab: static file system information
#
# file system dir   type  options   dump  pass
# /dev/sda1
UUID=c1213d5b-d7c8-468d-a7b1-f8618ed59c4a   /   ext4
rw,relatime,data=ordered0 1

BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=c1213d5b-d7c8-468d-a7b1-f8618ed59c4a ro
/etc/systemd/system:
total 20
-rw-r--r-- 1 root root  429 Jun  6 16:43 alsa-restore.service
drwxr-xr-x 2 root root 4096 May  6 08:08 getty.target.wants
-rw-r--r-- 1 root root 1640 May  7 08:33 getty@tty1.service
drwxr-xr-x 2 root root 4096 Jun  9 17:00 multi-user.target.wants
-rw-r--r-- 1 root root  800 Jun  6 16:58 systemd-udevd.service

/etc/systemd/system/getty.target.wants:
total 0
lrwxrwxrwx 1 root root 38 May  6 08:08 getty@tty1.service - 
/usr/lib/systemd/system/getty@.service

/etc/systemd/system/multi-user.target.wants:
total 0
lrwxrwxrwx 1 root root 39 May  6 08:25 dhcpcd@enp0s3.service - 
/usr/lib/systemd/system/dhcpcd@.service
lrwxrwxrwx 1 root root 40 May 30 13:55 remote-fs.target - 
/usr/lib/systemd/system/remote-fs.target
___

Re: [systemd-devel] systemd-shutdown static linking (was: Please proof-read: ...)

2013-06-10 Thread Lennart Poettering
On Mon, 10.06.13 14:10, Ross Lagerwall (rosslagerw...@gmail.com) wrote:

 On Mon, Jun 10, 2013 at 12:33:01PM +0200, Lennart Poettering wrote:
  This is really weird... (Though unrelated to systemd-shutdown, as this
  is generated before we execute it, replacing PID 1).
  
  -.mount is the mount unit is something we do not try to unmount at
  shutdown from normal systemd, as that's impossible to do at that
  point. The other file systems have a Conflicts=umount.target to get them
  unmounted at shutdown, but -.mount explicitly doesn.t 
  
  Ross, how exactly did you shutdown to get this? What does systemctl
  show -- -.mount show you? Does it any Conflicts= line?
  
 
 As root: halt
 
 I have attached the output of systemctl show -- -.mount and /etc/fstab
 and /proc/cmdline.
 
 I see that Conflicts=umount.target is set, though I have no idea why.
 
 I haven't changed too much in the setup, at least not related to
 mounting.

Hmm, this is certainly weird. normally -.mount should not have any such
conflicts. I really wonder where you got those from... What is the
contents of /run/systemd/generator/-.mount for you?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-shutdown static linking (was: Please proof-read: ...)

2013-06-10 Thread Ross Lagerwall
On Mon, Jun 10, 2013 at 08:30:40PM +0200, Lennart Poettering wrote:
  As root: halt
  
  I have attached the output of systemctl show -- -.mount and /etc/fstab
  and /proc/cmdline.
  
  I see that Conflicts=umount.target is set, though I have no idea why.
  
  I haven't changed too much in the setup, at least not related to
  mounting.
 
 Hmm, this is certainly weird. normally -.mount should not have any such
 conflicts. I really wonder where you got those from... What is the
 contents of /run/systemd/generator/-.mount for you?
 

# Automatically generated by systemd-fstab-generator

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

[Mount]
What=/dev/disk/by-uuid/c1213d5b-d7c8-468d-a7b1-f8618ed59c4a
Where=/
Type=ext4
FsckPassNo=1
Options=rw,relatime,data=ordered

A new freshly installed Arch VM also has Conflicts=umount.target set for
-.mount (as does my desktop).
That's after not changing the config at all.

Hope that helps,
-- 
Ross Lagerwall
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-shutdown static linking (was: Please proof-read: ...)

2013-06-09 Thread Ross Lagerwall
On Sat, Jun 08, 2013 at 05:06:50PM +0200, Zbigniew Jędrzejewski-Szmek wrote:
 Maybe mention that systemd-shutdown is statically linked (I know it
 can be inferred from the text, but being explicit might be better).

At least on Arch, it is still statically linked to libc and udev:
$ ldd /usr/lib/systemd/systemd-shutdown
linux-vdso.so.1 (0x7fff80bff000)
libudev.so.1 = /usr/lib/libudev.so.1 (0x7f9a43582000)
librt.so.1 = /usr/lib/librt.so.1 (0x7f9a4337a000)
libc.so.6 = /usr/lib/libc.so.6 (0x7f9a42fcd000)
/lib64/ld-linux-x86-64.so.2 (0x7f9a43794000)
libdl.so.2 = /usr/lib/libdl.so.2 (0x7f9a42dc9000)
libpthread.so.0 = /usr/lib/libpthread.so.0 (0x7f9a42bad000)

And if I run pacman -S glibc and then shutdown:
-.mount mount process exited, code=exited status=32
-.mount changed unmounting - mounted
Job -.mount/stop finished, result=failed
Failed unmounting /.

Should it be completely statically linked?

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