web-dev-qa-db-fra.com

Montage / TMP en tant que TMPFS sur Ubuntu 20.04

Je voudrais monter /tmp Sans entrée de fstab à l'aide de tmp.mount

Cependant, sur Ubuntu 20.04 LTS, cela ne semble pas fonctionner.

user@user-x1:~$ systemctl status tmp.mount 
Unit tmp.mount could not be found.
user@user-x1:~$ Sudo systemctl enable tmp.mount 
Failed to enable unit: Unit file tmp.mount does not exist.
user@user-x1:~$ Sudo systemctl cat tmp.mount 
No files found for tmp.mount.
user@user-x1:~$ cat /usr/share/systemd/tmp.mount 
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Temporary Directory (/tmp)
Documentation=https://systemd.io/TEMPORARY_DIRECTORIES
Documentation=man:file-hierarchy(7)
Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
ConditionPathIsSymbolicLink=!/tmp
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=swap.target

[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,nosuid,nodev

[Install]
WantedBy=local-fs.target
user@user-x1:~$ 

Que ce passe-t-il? Pourquoi SystemD disait-il que l'unité n'a pas pu être trouvée même si Bash Auto Tabbing remplit tmp.mount Et quel est le moyen le plus simple d'activer ce tmpfs sans aucune configuration?

1
x70766c

tMP.MOUNT n'est pas activé par défaut. Il suffit de copier et de l'activer

Sudo cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/ 
Sudo systemctl enable tmp.mount
2
ExploitFate