aboutsummaryrefslogtreecommitdiffstats
path: root/community/quassel
diff options
context:
space:
mode:
authortcely <tcely@users.noreply.github.com>2019-04-10 23:55:36 -0400
committerLeonardo Arena <rnalrd@alpinelinux.org>2019-04-11 13:27:53 +0000
commitff1b6292b8d0e0fba4b5abb230aeae8c93136d9c (patch)
tree3df284be5aead469fe56cd43e5ab7f6716151c45 /community/quassel
parenta8a18464a9bc392c03fa9b563cbcb5cdf1105aa0 (diff)
downloadaports-ff1b6292b8d0e0fba4b5abb230aeae8c93136d9c.tar.bz2
aports-ff1b6292b8d0e0fba4b5abb230aeae8c93136d9c.tar.xz
community/quassel: rewrite -openrc files
Diffstat (limited to 'community/quassel')
-rw-r--r--community/quassel/APKBUILD6
-rw-r--r--community/quassel/quasselcore.confd14
-rw-r--r--community/quassel/quasselcore.initd68
3 files changed, 44 insertions, 44 deletions
diff --git a/community/quassel/APKBUILD b/community/quassel/APKBUILD
index 66842f1b35..73da0f5434 100644
--- a/community/quassel/APKBUILD
+++ b/community/quassel/APKBUILD
@@ -2,7 +2,7 @@
pkgname=quassel
pkgver=0.13.1
-pkgrel=1
+pkgrel=2
url="https://www.quassel-irc.org/"
pkgdesc="Distributed IRC client - metapackage"
arch="all"
@@ -124,5 +124,5 @@ mono() {
}
sha512sums="4ed55e81b1638c8851ddae5d9c9d23a1c2cea92f307e19f426873c2600d8e183898d3ed7c290f2ea5d1b8c5e1be7f9ffcc3e8c3c0193d080fc879b10cc3a962c quassel-0.13.1.tar.bz2
-e03df342f47945f948106883a7757262ab7a8a7d21f0b4dd01cfcc95e836c2e00f2e0177a353b4f7a4b6f80ffa970be06d49aa9a42cad1f3834382267e5a0d7f quasselcore.confd
-a7181ea28d821e39c005aaaaeed821f815371f76c2e98bd5935013bb9a0ba0ab6fce9c202bab6be3eaa7895773150fc5832ea3ce9050dbea73d6db514f51da6a quasselcore.initd"
+56d4b05fcb2702c103a611a170e444e237bd7c8626219063e5853c3efa5d91e21fa9b726b056393070e35b7d7efe0a145ac3ab61413bc8033642d7acb622b638 quasselcore.confd
+7a0dd5a04b28c3099b4c9e98a25e6dc2b72bdb1e450e7299f9556487f6b34748ae881a4ccb955396e2ac0eab5d3fce4dbea426d7fa498d069f5d185057efa4cf quasselcore.initd"
diff --git a/community/quassel/quasselcore.confd b/community/quassel/quasselcore.confd
index c687337775..f912756a2b 100644
--- a/community/quassel/quasselcore.confd
+++ b/community/quassel/quasselcore.confd
@@ -1,7 +1,3 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/files/quasselcore.conf,v 1.5 2010/11/04 14:22:44 scarabeus Exp $
-
# Loglevel Debug|Info|Warning|Error. Default is: Info
# The logfile is located at /var/log/quassel.log.
#LOGLEVEL="Info"
@@ -9,14 +5,22 @@
# The address(es) quasselcore will listen on. Default is 0.0.0.0
#LISTEN="0.0.0.0"
+# Specify the network service that corresponds to the "bind" setting
+# in your configuration file. For example, if you bind to 127.0.0.1,
+# this should be set to "loopback" which provides the loopback interface.
+rc_need="loopback"
+
# The port quasselcore will listen at. Default is: 4242
#PORT="4242"
# User we want our daemon to run under.
#USER="quassel"
+# Group we want our daemon to run under.
+#GROUP="quassel"
+
# Directory we store all quasselcore content.
#CONFIGDIR="/var/lib/quassel"
# File quasselcore will log all its events into.
-#LOGFILE="/var/log/quassel.log" \ No newline at end of file
+#LOGFILE="/var/log/quassel.log"
diff --git a/community/quassel/quasselcore.initd b/community/quassel/quasselcore.initd
index 8a0ccbb778..a0f62b9df6 100644
--- a/community/quassel/quasselcore.initd
+++ b/community/quassel/quasselcore.initd
@@ -1,63 +1,59 @@
#!/sbin/openrc-run
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/files/quasselcore.init,v 1.8 2011/08/19 11:43:49 scarabeus Exp $
depend() {
- need localmount net
+ need localmount
after bootmisc postgres
}
-CORE="$(which quasselcore)"
-PID="/run/quassel.pid"
+name="Quassel Core"
+pidfile="/run/${RC_SVCNAME}.pid"
+command="/usr/bin/quasselcore"
+command_background="true"
+
+QUASSEL_USER="${USER:-quassel}"
+QUASSEL_GROUP="${GROUP:-quassel}"
+command_user="$QUASSEL_USER:$QUASSEL_GROUP"
+
+LOGLEVEL=${LOGLEVEL:-"Info"}
LOGFILE=${LOGFILE:-"/var/log/quassel.log"}
CONFIGDIR=${CONFIGDIR:-"/var/lib/quassel"}
-QUASSEL_USER=${QUASSEL_USER:-"quassel"}
+command_args="--configdir='${CONFIGDIR}' \
+ --logfile='${LOGFILE}' --loglevel='${LOGLEVEL}' \
+ ${LISTEN:+--listen='${LISTEN}'} ${PORT:+--port='${PORT}'}"
checkconfig() {
- # set defaults
- LOGLEVEL=${LOGLEVEL:-"Info"}
-
# check config folder
if [ ! -d "${CONFIGDIR}" ]; then
mkdir "${CONFIGDIR}" || return 1
fi
# permissions always changed just to avoid runtime issues
- chown -R "${QUASSEL_USER}":"${QUASSEL_USER}" "${CONFIGDIR}" || return 1
+ chown -R "$command_user" "${CONFIGDIR}" || return 1
# check log file
if [ ! -e "${LOGFILE}" ]; then
touch "${LOGFILE}" || return 1
fi
# permissions always changed just to avoid runtime issues
- chown "${QUASSEL_USER}":"${QUASSEL_USER}" "${LOGFILE}" || return 1
+ chown "$command_user" "${LOGFILE}" || return 1
}
-start() {
- checkconfig || return 1
-
- ebegin "Starting Quassel Core"
-
- if [ -n "${RC_UNAME}" ]; then
- # running on baselayout-2/openrc
- start-stop-daemon --start --user "${QUASSEL_USER}" --background --make-pidfile \
- --pidfile "${PID}" \
- --exec "${CORE}" -- --logfile="${LOGFILE}" --loglevel="${LOGLEVEL}" \
- ${LISTEN:+--listen="${LISTEN}"} ${PORT:+--port="${PORT}"} \
- --configdir="${CONFIGDIR}"
- else
- # running on baselayout-1
- start-stop-daemon --start --chuid "${QUASSEL_USER}" --background --make-pidfile \
- --pidfile "${PID}" --env HOME="${CONFIGDIR}" \
- --exec "${CORE}" -- --logfile="${LOGFILE}" --loglevel="${LOGLEVEL}" \
- ${LISTEN:+--listen="${LISTEN}"} ${PORT:+--port="${PORT}"} \
- --configdir="${CONFIGDIR}"
+start_pre() {
+ # If this isn't a restart, make sure that the user's config isn't
+ # busted before we try to start the daemon (this will produce
+ # better error messages than if we just try to start it blindly).
+ #
+ # If, on the other hand, this *is* a restart, then the stop_pre
+ # action will have ensured that the config is usable and we don't
+ # need to do that again.
+ if [ "${RC_CMD}" != "restart" ] ; then
+ checkconfig || return $?
fi
- eend $?
}
-stop() {
- ebegin "Stopping Quassel Core"
- start-stop-daemon --stop --pidfile "${PID}" --exec "${CORE}"
- eend $?
+stop_pre() {
+ # If this is a restart, check to make sure the user's config
+ # isn't busted before we stop the running daemon.
+ if [ "${RC_CMD}" = "restart" ] ; then
+ checkconfig || return $?
+ fi
}