Do not mask virtual file systems when using systemctl (#708378)

This enhancement removes the virtual file systems from the list of file
systems (shown below) to be masked.

The following output was captured using Fedora 19:

$ systemctl list-units --full --all -t mount
UNIT                          LOAD   ACTIVE   SUB     DESCRIPTION
-.mount                       loaded active   mounted /
boot.mount                    loaded active   mounted /boot
dev-hugepages.mount           loaded active   mounted Huge Pages File System
dev-mqueue.mount              loaded active   mounted POSIX Message Queue File System
proc-sys-fs-binfmt_misc.mount loaded inactive dead    Arbitrary Executable File Formats File System
run-user-1000-gvfs.mount      loaded active   mounted /run/user/1000/gvfs
sys-fs-fuse-connections.mount loaded active   mounted FUSE Control File System
sys-kernel-config.mount       loaded active   mounted Configuration File System
sys-kernel-debug.mount        loaded active   mounted Debug File System
tmp.mount                     loaded active   mounted Temporary Directory

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

10 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

Bug #708378 - Advertised new feature: Use systemctl runtime mask to
              prevent automounting (#701676) doesn't work
This commit is contained in:
Curtis Gedak 2013-10-05 11:17:56 -06:00 committed by Mike Fleetwood
parent 1562994c6d
commit 43de8e326a
1 changed files with 3 additions and 1 deletions

View File

@ -115,7 +115,9 @@ fi
# Use systemctl to prevent automount by masking currently unmasked mount points # Use systemctl to prevent automount by masking currently unmasked mount points
# #
if test "x$HAVE_SYSTEMCTL" = "xyes"; then if test "x$HAVE_SYSTEMCTL" = "xyes"; then
MOUNTLIST=`systemctl list-units --full --all -t mount --no-legend | grep -v masked | cut -f1 -d' '` 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 systemctl --runtime mask --quiet -- $MOUNTLIST
fi fi