summarylogtreecommitdiffstats
path: root/warsaw.openrc
diff options
context:
space:
mode:
authorManoel Vilela2017-08-08 06:08:42 -0300
committerManoel Vilela2018-01-25 15:55:09 -0300
commitb0e7bb6ae6ed7df645dae8a20ec1c2e3a588bd8d (patch)
tree984b254749bdcb7d95820f298ee051b83707d550 /warsaw.openrc
parentb88454db918cb2d2bfbfdbf2262bbefdef4ff661 (diff)
downloadaur-b0e7bb6ae6ed7df645dae8a20ec1c2e3a588bd8d.tar.gz
Add openrc-script alternative when user has OpenRC installed
This avoid the whole problem to remove the systemd service installed by default and write by yourself a OpenRC script. Beyond that, I remove the trailing spaces of the PKGBUILD file, fix the formatting and add triggers on post_install and pre_remove about OpenRC. I tested on my own machine and this seems works fine.
Diffstat (limited to 'warsaw.openrc')
-rwxr-xr-xwarsaw.openrc54
1 files changed, 54 insertions, 0 deletions
diff --git a/warsaw.openrc b/warsaw.openrc
new file mode 100755
index 000000000000..d950d3ad0494
--- /dev/null
+++ b/warsaw.openrc
@@ -0,0 +1,54 @@
+#!/usr/bin/openrc-run
+### BEGIN INIT INFO
+# Provides: warsaw
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Handles Warsaw - core
+# Description: Warsaw Technology - core
+# Developed by GAS Tecnologia<info@gastecnologia.com.br>
+# Copyright 2015 GAS Tecnologia
+#
+# Adapted to be a OpenRC script by: Manoel Vilela <manoel_vilela@engineer.com>
+### END INIT INFO
+
+PACKAGE=warsaw
+NAME=core
+DAEMON=/usr/local/bin/warsaw/$NAME
+TIMEOUT=5
+
+description="This service start the warsaw core daemon for Banking Security."
+
+depend() {
+ need localmount syslog-ng
+ after bootmisc dbus
+}
+
+checkconfig() {
+ if [ ! -f ${DAEMON} ]; then
+ eerror "The ${DAEMON} doesn't exists. Ensure {PACKAGE} is installed correctly."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ${NAME} daemon from ${PACKAGE}"
+ /usr/local/bin/warsaw/wscertmgr
+ start-stop-daemon --start \
+ --exec $DAEMON -- $DAEMON_OPTS
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${NAME} daemon from ${PACKAGE}"
+
+ start-stop-daemon --stop \
+ --retry "TERM/${TIMEOUT}/KILL/5" \
+ --exec ${DAEMON} -- ${DAEMON_OPTS}
+
+ eend $?
+}