Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
LibreOffice:Factory
libreoffice-online
loolwsd-timer.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File loolwsd-timer.patch of Package libreoffice-online
From 09929a894b57a20014f69d6e71793fb8c8025b12 Mon Sep 17 00:00:00 2001 From: Hillwood Yang <hillwood@opensuse.org> Date: Tue, 13 Oct 2020 22:13:42 +0800 Subject: [PATCH] Use systemd timer instead of cron job. (boo#1177528) Change-Id: I94d2517b2bdbafbfe9652e7d9c06ec5a5cff1d7a --- diff --git a/Makefile.am b/Makefile.am index e50b680..0ffce37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -303,6 +303,7 @@ loolwsd.spec \ loolwsd.xml.in \ loolwsd.service \ + loolwsd.timer\ sysconfig.loolwsd \ debian/compat \ debian/copyright \ diff --git a/loolwsd.spec.in b/loolwsd.spec.in index fa9919e..7b04f26 100644 --- a/loolwsd.spec.in +++ b/loolwsd.spec.in @@ -78,6 +78,7 @@ %install make install DESTDIR=%{buildroot} %__install -D -m 444 loolwsd.service %{buildroot}%{_unitdir}/loolwsd.service +%__install -D -m 444 loolwsd.timer %{buildroot}%{_unitdir}/loolwsd.service install -d -m 755 %{buildroot}/var/adm/fillup-templates %if 0%{?fedora} || 0%{?rhel} >= 7 install -D -m 644 sysconfig.loolwsd %{buildroot}/etc/sysconfig/loolwsd @@ -86,9 +87,6 @@ install -D -m 644 sysconfig.loolwsd %{buildroot}/var/adm/fillup-templates %endif %endif -mkdir -p %{buildroot}/etc/cron.d -echo "#Remove old tiles once every 10 days at midnight" > %{buildroot}/etc/cron.d/loolwsd.cron -echo "0 0 */1 * * root find /var/cache/loolwsd -type f -a -atime +10 -exec rm {} \;" >> %{buildroot}/etc/cron.d/loolwsd.cron mkdir -p %{buildroot}/etc/pam.d echo "auth required pam_unix.so" > %{buildroot}/etc/pam.d/loolwsd echo "account required pam_unix.so" >> %{buildroot}/etc/pam.d/loolwsd @@ -116,6 +114,7 @@ /usr/share/man/man1/loolwsd-systemplate-setup.1 /usr/share/man/man1/loolwsd-generate-proof-key.1 %{_unitdir}/loolwsd.service +%{_unitdir}/loolwsd.timer %if 0%{?fedora} || 0%{?rhel} >= 7 %config(noreplace) /etc/sysconfig/loolwsd %else @@ -124,7 +123,6 @@ %endif %endif -%config(noreplace) /etc/cron.d/loolwsd.cron %config(noreplace) /etc/pam.d/loolwsd %config(noreplace) %attr(640, lool, root) /etc/loolwsd/loolwsd.xml %config /etc/loolwsd/loolkitconfig.xcu @@ -133,7 +131,7 @@ %pre %if 0%{?suse_version} -%service_add_pre loolwsd.service +%service_add_pre loolwsd.service loolwsd.timer %endif getent group lool >/dev/null || groupadd -r lool @@ -161,10 +159,10 @@ loolwsd-generate-proof-key >/dev/null 2>&1 %if 0%{?fedora} || 0%{?rhel} >= 7 -%systemd_post loolwsd.service +%systemd_post loolwsd.service loolwsd.timer %else %if 0%{?suse_version} -%service_add_post loolwsd.service +%service_add_post loolwsd.service loolwsd.timer %{fillup_only -n loolwsd} %endif %endif @@ -172,19 +170,19 @@ %preun %if 0%{?fedora} || 0%{?rhel} >= 7 -%systemd_preun loolwsd.service +%systemd_preun loolwsd.service loolwsd.timer %else %if 0%{?suse_version} -%service_del_preun loolwsd.service +%service_del_preun loolwsd.service loolwsd.timer %endif %endif %postun %if 0%{?fedora} || 0%{?rhel} >= 7 -%systemd_postun loolwsd.service +%systemd_postun loolwsd.service loolwsd.timer %else %if 0%{?suse_version} -%service_del_postun loolwsd.service +%service_del_postun loolwsd.service loolwsd.timer %endif %endif diff --git a/loolwsd.timer b/loolwsd.timer new file mode 100644 index 0000000..1849e47 --- /dev/null +++ b/loolwsd.timer @@ -0,0 +1,13 @@ +[Unit] +Description=LibreOffice Online Timer: Remove old tiles once every 10 days at midnight +After=loolwsd.service + +[Timer] +OnActiveSec=1h +OnUnitActiveSec=10d +ExecStart=find /var/cache/loolwsd -type f -a -atime +10 -exec rm {} \; +Unit=loolwsd.timer +User=root + +[Install] +WantedBy=timers.target
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor