From: Michael Prokop Date: Fri, 25 Nov 2022 07:50:08 +0000 (+0100) Subject: Reload systemd after modifying fstab X-Git-Tag: v0.6.0~1 X-Git-Url: http://git.grml.org/?p=grml-udev-config.git;a=commitdiff_plain;h=365c6de7922578cf6bc04c0b7f77d354f5fa8300 Reload systemd after modifying fstab Otherwise e.g. mount(1) might complain about: | mount: (hint) your fstab has been modified, but systemd still uses | the old version; use `systemctl daemon-reload` to reload. Thanks: Chris Hofstaedtler for the bug report Closes: https://github.com/grml/grml-autoconfig/issues/12 --- diff --git a/scripts/grml-udev-rebuildfstab b/scripts/grml-udev-rebuildfstab index 40d8078..fc5e191 100755 --- a/scripts/grml-udev-rebuildfstab +++ b/scripts/grml-udev-rebuildfstab @@ -325,6 +325,12 @@ if [ -r "$MNTFILE" ] ; then cat $TMPFILE > $MNTFILE fi +# ensure systemd uses recent fstab configuration +if [ -d /run/systemd/system ]; then + logit 'Reloading systemd manager configuration to use current fstab' + systemctl daemon-reload +fi + bailout 0 ## END OF FILE #################################################################