From 13fed92262be920448d20119b891164fb04397e6 Mon Sep 17 00:00:00 2001 From: Bruno Cichon Date: Thu, 18 Aug 2016 21:06:02 +0200 Subject: Add openrc init script for yacy. --- pcr/yacy-openrc/PKGBUILD | 19 +++++++++++++++++++ pcr/yacy-openrc/yacy | 30 ++++++++++++++++++++++++++++++ pcr/yacy-openrc/yacy.install | 4 ++++ 3 files changed, 53 insertions(+) create mode 100644 pcr/yacy-openrc/PKGBUILD create mode 100755 pcr/yacy-openrc/yacy create mode 100644 pcr/yacy-openrc/yacy.install diff --git a/pcr/yacy-openrc/PKGBUILD b/pcr/yacy-openrc/PKGBUILD new file mode 100644 index 000000000..d01fd9390 --- /dev/null +++ b/pcr/yacy-openrc/PKGBUILD @@ -0,0 +1,19 @@ +# Maintainer: Bruno Cichoń +# Contributor: André Silva + +pkgname=yacy-openrc +pkgver=0.1.0 +pkgrel=1 +pkgdesc="OpenRC init script for YaCy" +arch=('any') +license=('GPL2') +depends=('openrc' 'yacy') +backup=('etc/init.d/yacy') +install=yacy.install +source=('yacy') +md5sums=('a65f7ac5a9e01cb8469eec2eb56e3af0') + +package() { + install -dm755 $pkgdir/etc/init.d + install -Dm755 $srcdir/yacy $pkgdir/etc/init.d +} \ No newline at end of file diff --git a/pcr/yacy-openrc/yacy b/pcr/yacy-openrc/yacy new file mode 100755 index 000000000..1f5d125fd --- /dev/null +++ b/pcr/yacy-openrc/yacy @@ -0,0 +1,30 @@ +#!/usr/bin/openrc-run + +PIDFile=/opt/yacy/.yacy/yacy.pid +User=yacy + +description="YaCy P2P Web Search" + +depend() { + need net +} + +start() { + ebegin "Starting Yacy" + start-stop-daemon --background --user "${User}" --start --pidfile "${PIDFILE}" --quiet --exec /opt/yacy/yacy start + eend $? +} + +stop() { + ebegin "Stopping Yacy" + start-stop-daemon --stop --pidfile "${PIDFILE}" --quiet --exec /opt/yacy/yacy stop + eend $? +} + +reload() { + ebegin "Reloading Yacy." + start-stop-daemon --stop --pidfile "${PIDFILE}" --quiet --exec /opt/yacy/yacy stop + start-stop-daemon --background --user "${User}" --start --pidfile "${PIDFILE}" --quiet --exec /opt/yacy/yacy start + #/opt/yacy/yacy restart + eend $? +} diff --git a/pcr/yacy-openrc/yacy.install b/pcr/yacy-openrc/yacy.install new file mode 100644 index 000000000..d07129617 --- /dev/null +++ b/pcr/yacy-openrc/yacy.install @@ -0,0 +1,4 @@ +post_install() { + echo " ==> /var/lib/yacy /opt/yacy needs these adjustments:" + echo " chown -R yacy:yacy /var/lib/yacy /opt/yacy" +} -- cgit v1.2.3