Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=kdetesting2.git;a=commitdiff;h=654c009ec6511ff0df97a6e7dd8027056d1c9e16
commit 654c009ec6511ff0df97a6e7dd8027056d1c9e16 Author: Miklos Vajna <vmik...@frugalware.org> Date: Sun Jan 16 00:50:24 2011 +0100 dcron-4.4-2-i686 - add crond.service for systemd diff --git a/source/base/dcron/FrugalBuild b/source/base/dcron/FrugalBuild index 9a8caf2..9b9e0c3 100644 --- a/source/base/dcron/FrugalBuild +++ b/source/base/dcron/FrugalBuild @@ -3,7 +3,7 @@ pkgname=dcron pkgver=4.4 -pkgrel=1 +pkgrel=2 pkgdesc="Dillon's Cron daemon" url="http://www.jimpryor.net/linux/dcron" depends=('glibc>=2.8-3') @@ -13,8 +13,10 @@ archs=('i686' 'x86_64' 'ppc') backup=(var/spool/cron/crontabs/root) up2date="Flasttar $url" source=(http://www.jimpryor.net/linux/releases/dcron-4.4.tar.gz \ + dcron4-add-systemd-unit-file.patch \ run-parts run-parts.8.gz rc.crond root rc.crond-{de,hu}.po) sha1sums=('111cccfbc1b253927764cf48980e5298293d8a7f' \ + 'b5c8ac94760866bdcb311ea849ff290101d77b24' \ 'b9fa3287f26a3f882bc50256b8a017f94458aa47' \ '7d4d036ba92819467b5186177e57fa0a861f86eb' \ '9fff45fbec9c97a5edc52db36e7f4fd1a95f8a0c' \ @@ -32,6 +34,7 @@ build() Fexe /usr/bin/run-parts Ffile /usr/man/man8/run-parts.8 Frcd2 crond + Ffilerel extra/crond.service /lib/systemd/system/crond.service } # optimization ok diff --git a/source/base/dcron/dcron.install b/source/base/dcron/dcron.install index 02b3491..e86249b 100644 --- a/source/base/dcron/dcron.install +++ b/source/base/dcron/dcron.install @@ -1,18 +1,39 @@ -# arg 1: the new package version post_install() { chkconfig --add rc.crond + # On install (not upgrade), enable (but don't start) the + # units by default + ln -sf '/lib/systemd/system/crond.service' '/etc/systemd/system/multi-user.target.wants/crond.service' +} + +post_upgrade() +{ + # Reload init system configuration, to make systemd honour + # changed unit files + systemctl daemon-reload >/dev/null 2>&1 + if [ `vercmp $2 4.4-2` -lt 0 ] ; then + if chkconfig rc.crond; then + post_install + fi + fi } -# arg 1: the old package version pre_remove() { chkconfig --del rc.crond + # On uninstall (not upgrade), disable and stop the units + rm -f '/etc/systemd/system/multi-user.target.wants/crond.service' + systemctl stop crond.service >/dev/null 2>&1 +} + +post_remove() +{ + # Reload init system configuration, to make systemd honour + # deleted unit files + systemctl daemon-reload >/dev/null 2>&1 } op=$1 shift $op $* - -# vim: ft=sh diff --git a/source/base/dcron/dcron4-add-systemd-unit-file.patch b/source/base/dcron/dcron4-add-systemd-unit-file.patch new file mode 100644 index 0000000..11b9485 --- /dev/null +++ b/source/base/dcron/dcron4-add-systemd-unit-file.patch @@ -0,0 +1,66 @@ +From: Jim Pryor <prof...@jimpryor.net> +To: Miklos Vajna <vmik...@frugalware.org> +Subject: Re: dcron-4.4 systemd service +Message-ID: <20110115192658.gp6...@vaio.jimpryor.net> +User-Agent: Mutt/1.5.21 (2010-09-15) + +On Sat, Jan 15, 2011 at 02:17:43AM +0100, Miklos Vajna wrote: +> Hi, +> +> I'm attaching a patch adding crond.service for systemd, based on +> crond.rc. I'm submitting it as a patch, as one of systemd's great idea +> is to let upstream ship service files, so the "every distro packager +> writes his own rc script" issue won't happen again. :) +> +> Thanks, +> +> Miklos + +Thanks Miklos, I'll fold this into next release, which I hope to be able +to get together soon. + +From 86d87f86fce00f1534987547233dfcea07cbd9ab Mon Sep 17 00:00:00 2001 +From: Miklos Vajna <vmik...@frugalware.org> +Date: Sat, 15 Jan 2011 02:01:46 +0100 +Subject: [PATCH] Add systemd unit file + +--- + README | 4 ++++ + extra/crond.service | 10 ++++++++++ + 2 files changed, 14 insertions(+), 0 deletions(-) + create mode 100644 extra/crond.service + +diff --git a/README b/README +index 3b8b9d3..a720009 100644 +--- a/README ++++ b/README +@@ -144,6 +144,10 @@ crond.rc + : This is an example rc script to start and stop crond. It could be placed in + /etc/rc.d or /etc/init.d in suitable systems. + ++crond.service ++: This is an example sysvinit service to start and stop crond. It ++could be placed in /lib/systemd/system in suitable systems. ++ + run-cron + : This simple shell script is a bare-bones alternative to Debian's run-parts. + +diff --git a/extra/crond.service b/extra/crond.service +new file mode 100644 +index 0000000..536404d +--- /dev/null ++++ b/extra/crond.service +@@ -0,0 +1,10 @@ ++[Unit] ++Description=Cron Daemon ++After=syslog.target ++ ++[Service] ++ExecStart=/usr/sbin/crond -S -l info ++Type=forking ++ ++[Install] ++WantedBy=multi-user.target +-- +1.7.3.4 + _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git