]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Creating /etc/systemd/system/tmp.mount.d/mount_options.conf in snippets/tpl.075.tmp...
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 14 Mar 2024 17:34:23 +0000 (18:34 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 14 Mar 2024 17:34:23 +0000 (18:34 +0100)
snippets/tpl.075.tmp-tmpfs.sh

index e16c8fa09b51b782f4d313df82da76ebeec6e83c..c159e8c6075b066108976020202ddef68f49d642 100644 (file)
@@ -10,7 +10,22 @@ setup_tmp_tmpfs() {
     echo
     log "Setting up /tmp as a tmpfs by a systemd mount unit ..."
     echo
+    if [[ ! -d /etc/systemd/system/tmp.mount.d ]] ; then
+        echo "Creating /etc/systemd/system/tmp.mount.d ..."
+        mkdir -pv /etc/systemd/system/tmp.mount.d
+        echo
+    fi
+    echo "Creating /etc/systemd/system/tmp.mount.d/mount_options.conf ..."
+    echo
+    cat <<-EOF >"/etc/systemd/system/tmp.mount.d/mount_options.conf"
+               [Mount]
+               Options=mode=1777,strictatime,nosuid,nodev,size=10%%,nr_inodes=1m
 
+               EOF
+    echo
+    echo "Content of /etc/systemd/system/tmp.mount.d/mount_options.conf:"
+    cat /etc/systemd/system/tmp.mount.d/mount_options.conf
+    echo
     echo "Enabling unit tmp.mount ..."
     systemctl enable tmp.mount