pid1: add GracefulOptions= setting to .mount units

This new setting can be used to specify mount options that shall only be
added to the mount option string if the kernel supports them.

This shall be used for adding "usrquota" to tmp.mount without breaking compat,
but is generally be useful.
This commit is contained in:
Lennart Poettering
2025-01-15 21:05:06 +01:00
parent f8214e2cca
commit 09fbff57fc
10 changed files with 161 additions and 9 deletions
+7
View File
@@ -185,3 +185,10 @@ systemctl status "$WORK_DIR/mnt"
touch "$WORK_DIR/mnt/hello"
[[ "$(stat -c "%U:%G" "$WORK_DIR/mnt/hello")" == "testuser:testuser" ]]
systemd-umount LABEL=owner-vfat
# Mkae sure that graceful mount options work
GRACEFULTEST="/tmp/graceful/$RANDOM"
systemd-mount --tmpfs -p GracefulOptions=idefinitelydontexist,nr_inodes=4711,idonexisteither "$GRACEFULTEST"
findmnt -n -o options "$GRACEFULTEST"
findmnt -n -o options "$GRACEFULTEST" | grep -q nr_inodes=4711
umount "$GRACEFULTEST"