Skip to content

Instantly share code, notes, and snippets.

@ryukinix
Created August 8, 2017 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryukinix/623a9d513c8dd61a7592cf4c2e6ef40c to your computer and use it in GitHub Desktop.
Save ryukinix/623a9d513c8dd61a7592cf4c2e6ef40c to your computer and use it in GitHub Desktop.
An OpenRC script for the Brazillian Security Module Warsaw from GAS Technology
#!/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 $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment