]> git.pld-linux.org Git - packages/earlyoom.git/commitdiff
Rel 2; add log file
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 8 Dec 2023 10:09:33 +0000 (11:09 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 8 Dec 2023 10:09:33 +0000 (11:09 +0100)
earlyoom.init
earlyoom.logrotate [new file with mode: 0644]
earlyoom.spec

index d594a3d7e76feda946b72a4e1916d3c51093d075..c1b29fdc0727fed05457d94299691ca674cd01ca 100644 (file)
@@ -27,7 +27,7 @@ start() {
        fi
 
        msg_starting "earlyoom"
-       daemon --fork --makepid /usr/bin/earlyoom $EARLYOOM_ARGS
+       start-stop-daemon --start --quiet --background --pidfile /var/log/earlyoom --exec /bin/sh -- -c "exec /usr/bin/earlyoom $EARLYOOM_ARGS 2> \"/var/log/earlyoom.log\"" && ok || fail
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/earlyoom
 }
diff --git a/earlyoom.logrotate b/earlyoom.logrotate
new file mode 100644 (file)
index 0000000..199a20e
--- /dev/null
@@ -0,0 +1,5 @@
+/var/log/earlyoom.log
+{
+    create 0644 root root
+    copytruncate
+}
index 45513e3dab51bfe2fc3cf45f670e581e4b51488c..d5828c6e8359ebf59c92c2554ca2dc02400cfcc5 100644 (file)
@@ -1,13 +1,14 @@
 Summary:       Early OOM Daemon for Linux
 Name:          earlyoom
 Version:       1.7
-Release:       1
+Release:       2
 License:       MIT
 URL:           https://github.com/rfjakob/earlyoom
 Source0:       https://github.com/rfjakob/earlyoom/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: 9c567930c60b2ccdc536951b005d413d
 Source1:       %{name}.conf
 Source2:       %{name}.init
+Source3:       %{name}.logrotate
 BuildRequires: pandoc
 Requires(post,preun):  /sbin/chkconfig
 Requires:      systemd-units
@@ -38,7 +39,7 @@ sed -i -e 's#/default/#/sysconfig/#g' Makefile earlyoom.service.in
 %install
 rm -rf $RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d}
 
 %{__make} install \
        PREFIX=%{_prefix} \
@@ -48,6 +49,7 @@ install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
        DESTDIR=$RPM_BUILD_ROOT
 
 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -71,6 +73,7 @@ fi
 %defattr(644,root,root,755)
 %doc README.md
 %attr(754,root,root) /etc/rc.d/init.d/%{name}
+%config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
 %attr(755,root,root) %{_bindir}/%{name}
 %{systemdunitdir}/%{name}.service
 %{_mandir}/man1/%{name}.*
This page took 0.157302 seconds and 4 git commands to generate.