summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authorBruno Cichon <ebrasca.ebrasca@openmailbox.org>2016-08-18 21:06:02 +0200
committerBruno Cichon <ebrasca.ebrasca@openmailbox.org>2016-08-18 21:06:02 +0200
commit13fed92262be920448d20119b891164fb04397e6 (patch)
tree4474fb0caf119fa36dea37eef4234666dbde4526 /pcr
parentd9ea5495f669654f9b96835fcdbb76a239255544 (diff)
downloadabslibre-13fed92262be920448d20119b891164fb04397e6.tar.gz
abslibre-13fed92262be920448d20119b891164fb04397e6.tar.bz2
abslibre-13fed92262be920448d20119b891164fb04397e6.zip
Add openrc init script for yacy.
Diffstat (limited to 'pcr')
-rw-r--r--pcr/yacy-openrc/PKGBUILD19
-rwxr-xr-xpcr/yacy-openrc/yacy30
-rw-r--r--pcr/yacy-openrc/yacy.install4
3 files changed, 53 insertions, 0 deletions
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ń <ebrasca.ebrasca@openmailbox.org>
+# Contributor: André Silva <emulatorman@parabola.nu>
+
+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"
+}