]> git.pld-linux.org Git - packages/systemd.git/commitdiff
- add handler for $CLEAN_TMP
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 29 Mar 2012 07:02:41 +0000 (07:02 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    pld-clean-tmp.service -> 1.1
    pld-clean-tmp.sh -> 1.1
    systemd.spec -> 1.141

pld-clean-tmp.service [new file with mode: 0644]
pld-clean-tmp.sh [new file with mode: 0644]
systemd.spec

diff --git a/pld-clean-tmp.service b/pld-clean-tmp.service
new file mode 100644 (file)
index 0000000..8fdd42b
--- /dev/null
@@ -0,0 +1,14 @@
+[Unit]
+Description=Clean /tmp on startup
+DefaultDependencies=no
+After=remount-rootfs.service
+
+[Service]
+ExecStart=/lib/systemd/pld-clean-tmp
+Type=oneshot
+TimeoutSec=0
+RemainAfterExit=yes
+StandardOutput=journal+console
+
+[Install]
+WantedBy=basic.target
diff --git a/pld-clean-tmp.sh b/pld-clean-tmp.sh
new file mode 100644 (file)
index 0000000..b0952a7
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+# Read functions
+. /lib/rc-scripts/functions
+
+# Clean /tmp
+if is_yes "$CLEAN_TMP" && ! is_fsmounted tmpfs /tmp; then
+       LC_ALL=C rm -rf /tmp/* /tmp/.[a-zA-Z0-9]*
+fi
index 1c994a6aa4a1c383f182664923cf91883a74145b..6516d68a72f137b740f2fc2532f1fd5bc7d73411 100644 (file)
@@ -30,6 +30,8 @@ Source10:     pld-storage-init-late.service
 Source11:      pld-storage-init.service
 Source12:      pld-wait-storage.service
 Source13:      pld-storage-init.sh
+Source14:      pld-clean-tmp.service
+Source15:      pld-clean-tmp.sh
 Patch0:                target-pld.patch
 Patch1:                config-pld.patch
 Patch2:                shut-sysv-up.patch
@@ -380,10 +382,13 @@ cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/compat-pld-var-run.con
 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/pld-storage-init-late.service
 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}/pld-storage-init.service
 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/pld-wait-storage.service
+cp -p %{SOURCE14} $RPM_BUILD_ROOT%{systemdunitdir}/pld-clean-tmp.service
 install -p %{SOURCE13} $RPM_BUILD_ROOT/lib/systemd/pld-storage-init
+install -p %{SOURCE15} $RPM_BUILD_ROOT/lib/systemd/pld-clean-tmp
 
-ln -s ../pld-storage-init-late.service $RPM_BUILD_ROOT%{systemdunitdir}/local-fs.target.wants/pld-storage-init-late.service
-ln -s ../pld-storage-init.service $RPM_BUILD_ROOT%{systemdunitdir}/local-fs.target.wants/pld-storage-init.service
+ln -s ../pld-storage-init-late.service $RPM_BUILD_ROOT%{systemdunitdir}/local-fs.target.wants
+ln -s ../pld-storage-init.service $RPM_BUILD_ROOT%{systemdunitdir}/local-fs.target.wants
+ln -s ../pld-clean-tmp.service $RPM_BUILD_ROOT%{systemdunitdir}/local-fs.target.wants
 
 # handled by rc-local sysv service, no need for generator
 %{__rm} $RPM_BUILD_ROOT/lib/systemd/system-generators/systemd-rc-local-generator
This page took 0.271012 seconds and 4 git commands to generate.