Date: Thursday, August 30, 2012 @ 13:34:52 Author: thomas Revision: 165802
upgpkg: watchdog 5.12-2: Add systemd unit file for watchdog Added: watchdog/trunk/watchdog.systemd Modified: watchdog/trunk/PKGBUILD watchdog/trunk/watchdog.sh ------------------+ PKGBUILD | 16 +++++++++++----- watchdog.sh | 4 ++-- watchdog.systemd | 10 ++++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2012-08-30 16:58:57 UTC (rev 165801) +++ PKGBUILD 2012-08-30 17:34:52 UTC (rev 165802) @@ -3,7 +3,7 @@ pkgname=watchdog pkgver=5.12 -pkgrel=1 +pkgrel=2 pkgdesc="Watchdog daemon" arch=(i686 x86_64) url="http://sourceforge.net/projects/watchdog" @@ -15,11 +15,13 @@ source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz watchdog.sh watchdog.cf - watchdog-5.12-fix-oom-in-wd_keepalive.patch) + watchdog-5.12-fix-oom-in-wd_keepalive.patch + watchdog.systemd) md5sums=('cea28bea70e54f3625062bc808aef9af' - '854451f554718b55186599faaa8d85f6' + 'f57d33967eb9404dd52e3c4e73795a20' '01c1e2e13f515131180b4ebe9b8b7cc3' - 'c90c2686975b5254f82b3de683f1f442') + 'c90c2686975b5254f82b3de683f1f442' + 'a835ae5cbdbb21c19a468dedb5d734e4') build() { cd "${srcdir}"/${pkgname}-${pkgver} @@ -29,7 +31,10 @@ --prefix=/usr \ --mandir=/usr/share/man \ --sysconfdir=/etc \ - --localstatedir=/var + --localstatedir=/var \ + --with-pidfile=/run/watchdog.pid \ + --with-ka_pidfile=/run/wd_keepalive.pid + make } @@ -40,6 +45,7 @@ install -D -m755 "${srcdir}"/watchdog.sh "${pkgdir}"/etc/rc.d/${fil} install -D -m644 "${srcdir}"/watchdog.cf "${pkgdir}"/etc/conf.d/${fil} done + install -D -m644 "${srcdir}"/watchdog.systemd "${pkgdir}"/usr/lib/systemd/system/watchdog.service sed -i 's/watchdog/wd_keepalive/g' "${pkgdir}"/etc/rc.d/wd_keepalive sed -i 's/watchdog/wd_keepalive/g' "${pkgdir}"/etc/conf.d/wd_keepalive Modified: watchdog.sh =================================================================== --- watchdog.sh 2012-08-30 16:58:57 UTC (rev 165801) +++ watchdog.sh 2012-08-30 17:34:52 UTC (rev 165802) @@ -3,7 +3,7 @@ . /etc/rc.conf . /etc/rc.d/functions -PID="$( cat /var/run/watchdog.pid 2>/dev/null )" +PID="$( cat /run/watchdog.pid 2>/dev/null )" [ -r /etc/conf.d/watchdog ] && source /etc/conf.d/watchdog case "$1" in @@ -31,7 +31,7 @@ stat_done fi - rm -f /var/run/watchdog.pid + rm -f /run/watchdog.pid ;; restart) $0 stop Added: watchdog.systemd =================================================================== --- watchdog.systemd (rev 0) +++ watchdog.systemd 2012-08-30 17:34:52 UTC (rev 165802) @@ -0,0 +1,10 @@ +[Unit] +Description=Watchdog Daemon + +[Service] +Type=forking +PIDFile=/run/watchdog.pid +ExecStart=/usr/sbin/watchdog + +[Install] +WantedBy=multi-user.target