chiark / gitweb /
units: add default tmpwatch units
authorLennart Poettering <lennart@poettering.net>
Tue, 21 Sep 2010 01:38:32 +0000 (03:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Sep 2010 01:38:32 +0000 (03:38 +0200)
Makefile.am
fixme
units/tmpwatch.service [new file with mode: 0644]
units/tmpwatch.timer [new file with mode: 0644]

index 3ab79ba87595458b782bef35b799d8848cecaba2..b5b2a9d21cdcdd16e0f6225a9ed63c4b38dafe02 100644 (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 )
diff --git a/fixme b/fixme
index 4e29ae3c9e8192461e463933bc0c659d7cdba5e4..38c7dbd2d408933f1270e22f7423185d20d08515 100644 (file)
--- a/fixme
+++ b/fixme
@@ -99,8 +99,6 @@
 
 * properly handle bind mounts in /etc/fstab
 
-* cleanup /tmp.
-
 External:
 
 * place /etc/inittab with explaining blurb.
diff --git a/units/tmpwatch.service b/units/tmpwatch.service
new file mode 100644 (file)
index 0000000..55f8f0a
--- /dev/null
@@ -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
diff --git a/units/tmpwatch.timer b/units/tmpwatch.timer
new file mode 100644 (file)
index 0000000..222e3d2
--- /dev/null
@@ -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