Skip to content
Snippets Groups Projects
Commit 314fc950 authored by Hoang Nguyen's avatar Hoang Nguyen :turtle: Committed by alice
Browse files

community/fcron: improve

- Set fifodir to /run to be the same as piddir (the default is
  $localstatedir/run)
- Simplify init script, allow customization of command_args
- Correct init script permission to 0755 (was 0775)
- Recompile systab file on post-install and post-upgrade events
- Set fcron user HOME to /var/spool/fcron
parent 62326820
No related branches found
No related tags found
1 merge request!41514community/fcron: improve
Pipeline #144317 passed
# Maintainer: Diaz Devera Victor <vitronic2@gmail.com>
pkgname=fcron
pkgver=3.3.1
pkgrel=1
pkgdesc="periodical command scheduler for systems not always up"
pkgrel=2
pkgdesc="Periodical command scheduler for systems not always up"
url="http://fcron.free.fr/"
install="fcron.pre-install"
install="fcron.pre-install fcron.post-install fcron.post-upgrade"
options="suid !check"
pkgusers="fcron"
pkggroups="fcron"
......@@ -12,9 +12,12 @@ arch="all"
license="GPL"
makedepends="readline-dev perl"
subpackages="$pkgname-openrc $pkgname-pam::noarch $pkgname-doc"
source="http://fcron.free.fr/archives/$pkgname-$pkgver.src.tar.gz
source="
http://fcron.free.fr/archives/fcron-$pkgver.src.tar.gz
systab.orig
fcron.initd"
fcron.initd
fcron.confd
"
build() {
./configure --prefix=/usr \
......@@ -24,6 +27,7 @@ build() {
--with-answer-all=no \
--with-boot-install=no \
--localstatedir=/var \
--with-fifodir=/run \
--with-piddir=/run \
--with-sendmail=no \
--with-selinux=no \
......@@ -33,8 +37,8 @@ build() {
package() {
make DESTDIR="$pkgdir/" install
install -Dm775 "$srcdir"/fcron.initd $pkgdir/etc/init.d/fcron
rm -r "$pkgdir"/var/run
install -Dm755 "$srcdir"/fcron.initd "$pkgdir"/etc/init.d/fcron
install -Dm644 "$srcdir"/fcron.confd "$pkgdir"/etc/conf.d/fcron
#for some reason it man/fr is not compressed, for that reason I erase
rm -r "$pkgdir"/usr/share/man/fr
install -Dm640 "$srcdir/systab.orig" "$pkgdir/var/spool/fcron/systab.orig"
......@@ -50,5 +54,6 @@ pam() {
sha512sums="
b9c5066bdf8588a6b8d811ccc0d49f1d41a17dabf898a280997a8136dc449c2a505c46868abf732f86184ff0720d51f17442691909acae8fb26edcd180cff281 fcron-3.3.1.src.tar.gz
e0abf7da0a9c1c2a8791f9f5b8cdb99260ac3bc49b0e4906ec3fb0d3344f8fe3819a7a80b1bc7b463fe4bc4499686e84ebb33aef9a0ec2298855b06340723e43 systab.orig
f87c9c9664611cd529b5f46affe5c3ff7af8fd2800b74958c34730a5ca564d888b5ddbfe18fa1ee20d4e26ed800ca38ed7f9626dd39ca2d3fc930be1ad78f4c5 fcron.initd
5b09016e3387f03978ff970cb252e7b405aa09582435d71bb5c3e6cd9cf9f0ab109c8657d68a884e143f5692e8adefb6c1beea3117390449b8c5db7ac72c2852 fcron.initd
543f77d4613cd848369a4d2ac0f33c5b6991d5a02be2d2d16824b0020bec6d2816c162f3b3aa97530212ac450123eae2f6b2ce3af12c25887187845e9934b004 fcron.confd
"
# enter the cron options
CRON_OPTS=""
......@@ -4,26 +4,12 @@
# Copyright 2014 Alpine Linux
# Distributed under the terms of the GNU General Public License v2
#name="advanced periodic command scheduler fcron"
name="fcron"
pidfile="/run/fcron"
command=/usr/sbin/fcron
name="$SVCNAME"
pidfile="/run/$SVCNAME.pid"
command="/usr/sbin/$SVCNAME"
command_args="$CRON_OPTS"
depend() {
need localmount
need logger
}
start() {
ebegin "Starting $name"
start-stop-daemon --start --exec ${command} \
--pidfile "$pidfile.pid"
eend $?
}
stop() {
ebegin "Stopping $name"
start-stop-daemon --stop --exec ${command} \
--pidfile "$pidfile.pid"
eend $?
}
#!/bin/sh
/usr/bin/fcrontab -z -u systab 2>/dev/null
fcron.post-install
\ No newline at end of file
#!/bin/sh
addgroup -S fcron 2>/dev/null
adduser -S -D -H -s /sbin/nologin -G fcron -g fcron fcron 2>/dev/null
adduser -S -D -H -h /var/spool/fcron -s /sbin/nologin -G fcron -g fcron fcron 2>/dev/null
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment