clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
521 stars 29 forks source link

several *ctl commands fail while gparted is running #943

Open mdhorn opened 5 years ago

mdhorn commented 5 years ago

While 'gparted' is running on a system, the following commands fail:

Failed to query server: Unit -.mount is masked.

From journalctl:

Jun 25 15:16:50 mhorn-linux dbus-daemon[582]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.855' (uid=1000 pid=11141 comm="hostnamectl ")
Jun 25 15:16:50 mhorn-linux dbus-daemon[582]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.hostname1.service': Unit -.mount is masked.

The difference in output for systemctl with and without gparted running:

32c32
< ● -.mount                      masked active mounted   Root Mount
---
>   -.mount                      loaded active mounted   Root Mount
34,37c34,37
< ● run-user-1001.mount          masked active mounted   /run/user/1001
< ● tmp.mount                    masked active mounted   /tmp
< ● usr-lib-debug.mount          masked active mounted   /usr/lib/debug
< ● usr-src-debug.mount          masked active mounted   /usr/src/debug
---
>   run-user-1001.mount          loaded active mounted   /run/user/1001
>   tmp.mount                    loaded active mounted   Temporary Directory (/tmp)
>   usr-lib-debug.mount          loaded active mounted   /usr/lib/debug
>   usr-src-debug.mount          loaded active mounted   /usr/src/debug
mdhorn commented 5 years ago

A couple of these commands appear to require mount, but the two I'm most concerned with should not need or be blocked by mount: localectl and timedatectl

mdhorn commented 5 years ago

To enable the advanced disk configuration in the graphical installer we will need the users to create partition labels in Gparted. Currently when Gparted is running the installer will fail due to both timedatectl and localectl being blocked.

$ timedatectl 
Failed to query server: Unit -.mount is masked.
$ localectl 
Could not get properties: Unit -.mount is masked.

I'm guessing the desired effect was to prevent mounting or unmounting while Gparted is active, but it is having more wide-reaching impact.

Any pointers to what sort of changes to systemd or configuration might need to be updated to prevent this?

mdhorn commented 5 years ago

Having gaprted running also seem to make some swupd post install hooks fail

sudo swupd bundle-add games
...

Calling post-update helper scripts
Failed to try-restart clr_debug_fuse.service: Unit -.mount is masked.
Failed to restart: clr_debug_fuse.service (systemctl returned error code: 256)
clr_debug_fuse.service: restarted (the binary was updated)
lebensterben commented 5 years ago

Is this related? [gparted] Use systemctl runtime mask to prevent automounting (#701676) https://mail.gnome.org/archives/commits-list/2013-June/msg02910.html

Sent with GitHawk

mdhorn commented 5 years ago

Is this related? [gparted] Use systemctl runtime mask to prevent automounting (#701676) https://mail.gnome.org/archives/commits-list/2013-June/msg02910.html

Sent with GitHawk

Very like part of the reason. gparted is masking the root mount which then causes a bunch of commands to fail.

What is not clear is who is wrong? Masking of root (-.mount) or the commands that are failing because of the mask?

lebensterben commented 5 years ago

Is this related? [gparted] Use systemctl runtime mask to prevent automounting (#701676) mail.gnome.org/archives/commits-list/2013-June/msg02910.html Sent with GitHawk

Very like part of the reason. gparted is masking the root mount which then causes a bunch of commands to fail.

What is not clear is who is wrong? Masking of root (-.mount) or the commands that are failing because of the mask?

I believe find the culprit. https://github.com/GNOME/gparted/blob/b5f1d5d5fee7f6ab6d24d34a621a7d1214fc5cf4/gparted.in#L143-L151

#
#  Use systemctl to prevent automount by masking currently unmasked mount points
#
if test "x$HAVE_SYSTEMCTL" = "xyes"; then
    MOUNTLIST=`systemctl list-units --full --all -t mount --no-legend \
      | grep -v masked | cut -f1 -d' ' \
      | egrep -v '^(dev-hugepages|dev-mqueue|proc-sys-fs-binfmt_misc|run-user-.*-gvfs|sys-fs-fuse-connections|sys-kernel-config|sys-kernel-debug)'`
    systemctl --runtime mask --quiet -- $MOUNTLIST
fi

So /usr/bin/gparted mask mount points including -.mount and then launch /usr/bin/gpartedbin, which is the GUI application. It won't unmask those mount points unless /usr/bin/gpartedbin exits.