1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

units: add default tmpwatch units

This commit is contained in:
Lennart Poettering 2010-09-21 03:38:32 +02:00
parent 653ab83b18
commit f0a73e245c
4 changed files with 41 additions and 4 deletions

View File

@ -979,12 +979,16 @@ install-data-hook:
dev-mqueue.automount \
proc-sys-fs-binfmt_misc.automount \
sys-kernel-debug.automount \
sys-kernel-security.automount && \
sys-kernel-security.automount \
tmpwatch.timer \
tmpwatch.service && \
$(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
$(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
$(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
$(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
$(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
$(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount && \
$(LN_S) ../tmpwatch.timer && \
$(LN_S) ../tmpwatch.service )
( cd $(DESTDIR)$(dbussessionservicedir) && \
rm -f org.freedesktop.systemd1.service && \
$(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )

2
fixme
View File

@ -99,8 +99,6 @@
* properly handle bind mounts in /etc/fstab
* cleanup /tmp.
External:
* place /etc/inittab with explaining blurb.

21
units/tmpwatch.service Normal file
View File

@ -0,0 +1,21 @@
# 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=Cleanup of Temporary Directories
DefaultDependencies=no
Wants=local-fs.target
After=local-fs.target
Before=poweroff.service reboot.service halt.service killall.service
[Service]
Type=oneshot
ExecStart=/usr/sbin/tmpwatch -umc -x /tmp/.X11-unix -x /tmp/.ICE-unix 10d /tmp
ExecStart=/usr/sbin/tmpwatch -umc 30d /var/tmp
[Install]
WantedBy=shutdown.target

14
units/tmpwatch.timer Normal file
View File

@ -0,0 +1,14 @@
# 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=Daily Cleanup of Temporary Directories
DefaultDependency=no
[Timer]
OnBootSec=1d
OnUnitActiveSec=1d