mirror of
https://github.com/systemd/systemd
synced 2024-10-15 20:45:09 +00:00
units: mount /tmp as tmpfs
The default setups should be a stateless as possible. /tmp as tmpfs is the intended default for general purpose systems. Small temporary files should not be stored on disk; lager files, or files which should potentially survive a reboot, belong into /var/tmp. Also catch up with some good old UNIX history. More details are here: https://fedoraproject.org/wiki/Features/tmp-on-tmpfs
This commit is contained in:
parent
55d029addf
commit
623ac9d2fc
|
@ -289,6 +289,7 @@ dist_systemunit_DATA = \
|
||||||
units/sys-kernel-config.mount \
|
units/sys-kernel-config.mount \
|
||||||
units/sys-kernel-debug.mount \
|
units/sys-kernel-debug.mount \
|
||||||
units/sys-fs-fuse-connections.mount \
|
units/sys-fs-fuse-connections.mount \
|
||||||
|
units/tmp.mount \
|
||||||
units/remount-rootfs.service \
|
units/remount-rootfs.service \
|
||||||
units/printer.target \
|
units/printer.target \
|
||||||
units/sound.target \
|
units/sound.target \
|
||||||
|
@ -2275,10 +2276,12 @@ systemd-install-data-hook:
|
||||||
( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
|
( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
|
||||||
rm -f systemd-remount-api-vfs.service \
|
rm -f systemd-remount-api-vfs.service \
|
||||||
fsck-root.service \
|
fsck-root.service \
|
||||||
remount-rootfs.service && \
|
remount-rootfs.service \
|
||||||
|
tmp.mount && \
|
||||||
$(LN_S) ../systemd-remount-api-vfs.service systemd-remount-api-vfs.service && \
|
$(LN_S) ../systemd-remount-api-vfs.service systemd-remount-api-vfs.service && \
|
||||||
$(LN_S) ../fsck-root.service fsck-root.service && \
|
$(LN_S) ../fsck-root.service fsck-root.service && \
|
||||||
$(LN_S) ../remount-rootfs.service remount-rootfs.service )
|
$(LN_S) ../remount-rootfs.service remount-rootfs.service && \
|
||||||
|
$(LN_S) ../tmp.mount tmp.mount )
|
||||||
( cd $(DESTDIR)$(userunitdir) && \
|
( cd $(DESTDIR)$(userunitdir) && \
|
||||||
rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \
|
rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \
|
||||||
$(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
|
$(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
|
||||||
|
|
16
units/tmp.mount
Normal file
16
units/tmp.mount
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# This file is part of systemd.
|
||||||
|
#
|
||||||
|
# systemd is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Temporary Directory
|
||||||
|
Before=local-fs.target
|
||||||
|
|
||||||
|
[Mount]
|
||||||
|
What=tmpfs
|
||||||
|
Where=/tmp
|
||||||
|
Type=tmpfs
|
||||||
|
Options=mode=1777
|
Loading…
Reference in a new issue