diff options
Diffstat (limited to 'app-admin/logcheck/files')
-rw-r--r-- | app-admin/logcheck/files/logcheck-r4.cron | 11 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.cron | 15 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.cron.d | 1 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.service | 11 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.timer | 8 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.tmpfiles | 2 |
6 files changed, 41 insertions, 7 deletions
diff --git a/app-admin/logcheck/files/logcheck-r4.cron b/app-admin/logcheck/files/logcheck-r4.cron new file mode 100644 index 000000000000..1a8809ffe154 --- /dev/null +++ b/app-admin/logcheck/files/logcheck-r4.cron @@ -0,0 +1,11 @@ +#!/bin/sh +# +# To enable sync via cron, execute "runuser -u logcheck touch /etc/logcheck/cron-logcheck-enabled" +if [[ ! -f /etc/logcheck/cron-logcheck-enabled ]]; then + exit +fi +if [ ! -d /var/lock/logcheck ]; then + mkdir -p /var/lock/logcheck + chown logcheck:logcheck /var/lock/logcheck +fi +/sbin/runuser -u logcheck -- nice -n10 /usr/sbin/logcheck "$@" diff --git a/app-admin/logcheck/files/logcheck.cron b/app-admin/logcheck/files/logcheck.cron index 3b3f4fcf62bd..091e1bd895b7 100644 --- a/app-admin/logcheck/files/logcheck.cron +++ b/app-admin/logcheck/files/logcheck.cron @@ -1,10 +1,11 @@ -#!/bin/bash - -set -e - +#!/bin/sh +# +# To enable sync via cron, execute "sudo -u logcheck touch /etc/logcheck/cron-logcheck-enabled" +if [[ ! -f /etc/logcheck/cron-logcheck-enabled ]]; then + exit +fi if [ ! -d /var/lock/logcheck ]; then mkdir -p /var/lock/logcheck + chown logcheck:logcheck /var/lock/logcheck fi -chown -R logcheck:logcheck /var/lock/logcheck - -su -s /bin/bash -c /usr/sbin/logcheck logcheck +sudo -u logcheck nice -n10 /usr/sbin/logcheck diff --git a/app-admin/logcheck/files/logcheck.cron.d b/app-admin/logcheck/files/logcheck.cron.d new file mode 100644 index 000000000000..bd95c1a95b5c --- /dev/null +++ b/app-admin/logcheck/files/logcheck.cron.d @@ -0,0 +1 @@ +@reboot sleep 60; /etc/cron.hourly/logcheck -R diff --git a/app-admin/logcheck/files/logcheck.service b/app-admin/logcheck/files/logcheck.service new file mode 100644 index 000000000000..8d5cd4ac467c --- /dev/null +++ b/app-admin/logcheck/files/logcheck.service @@ -0,0 +1,11 @@ +[Unit] +Description=Mails anomalies in the system logfiles to the administrator + +[Service] +Type=oneshot +ExecStart=/usr/sbin/logcheck +SyslogIdentifier=logcheck +User=logcheck + +[Install] +WantedBy=multi-user.target diff --git a/app-admin/logcheck/files/logcheck.timer b/app-admin/logcheck/files/logcheck.timer new file mode 100644 index 000000000000..db5fc229a16e --- /dev/null +++ b/app-admin/logcheck/files/logcheck.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Mails anomalies in the system logfiles to the administrator + +[Timer] +OnCalendar=hourly + +[Install] +WantedBy=timers.target diff --git a/app-admin/logcheck/files/logcheck.tmpfiles b/app-admin/logcheck/files/logcheck.tmpfiles new file mode 100644 index 000000000000..7d358900103a --- /dev/null +++ b/app-admin/logcheck/files/logcheck.tmpfiles @@ -0,0 +1,2 @@ +# logcheck lock directory +d /var/lock/logcheck 0755 logcheck logcheck - |