diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-irc/quassel/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-irc/quassel/files')
-rw-r--r-- | net-irc/quassel/files/quassel.logrotate | 9 | ||||
-rw-r--r-- | net-irc/quassel/files/quasselcore.conf | 21 | ||||
-rw-r--r-- | net-irc/quassel/files/quasselcore.conf-r1 | 11 | ||||
-rw-r--r-- | net-irc/quassel/files/quasselcore.init | 62 | ||||
-rw-r--r-- | net-irc/quassel/files/quasselcore.init-r1 | 22 | ||||
-rw-r--r-- | net-irc/quassel/files/quasselcore.service | 11 |
6 files changed, 136 insertions, 0 deletions
diff --git a/net-irc/quassel/files/quassel.logrotate b/net-irc/quassel/files/quassel.logrotate new file mode 100644 index 000000000000..8e7208350020 --- /dev/null +++ b/net-irc/quassel/files/quassel.logrotate @@ -0,0 +1,9 @@ +/var/log/quassel.log { + compress + rotate 4 + weekly + delaycompress + copytruncate + missingok + notifempty +} diff --git a/net-irc/quassel/files/quasselcore.conf b/net-irc/quassel/files/quasselcore.conf new file mode 100644 index 000000000000..960203500fe4 --- /dev/null +++ b/net-irc/quassel/files/quasselcore.conf @@ -0,0 +1,21 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Loglevel Debug|Info|Warning|Error. Default is: Info +# The logfile is located at /var/log/quassel.log. +#LOGLEVEL="Info" + +# The address(es) quasselcore will listen on. Default is 0.0.0.0 +#LISTEN="0.0.0.0" + +# The port quasselcore will listen at. Default is: 4242 +#PORT="4242" + +# User we want our daemon to run under. +#QUASSEL_USER="quassel" + +# Directory we store all quasselcore content. +#CONFIGDIR="/var/lib/quassel" + +# File quasselcore will log all its events into. +#LOGFILE="/var/log/quassel.log" diff --git a/net-irc/quassel/files/quasselcore.conf-r1 b/net-irc/quassel/files/quasselcore.conf-r1 new file mode 100644 index 000000000000..29e14467a8f3 --- /dev/null +++ b/net-irc/quassel/files/quasselcore.conf-r1 @@ -0,0 +1,11 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Loglevel Debug|Info|Warning|Error. Default is: Info +#LOGLEVEL="Info" + +# The address(es) quasselcore will listen on. Default is 0.0.0.0 +#LISTEN="0.0.0.0" + +# The port quasselcore will listen at. Default is: 4242 +#PORT="4242" diff --git a/net-irc/quassel/files/quasselcore.init b/net-irc/quassel/files/quasselcore.init new file mode 100644 index 000000000000..468c24ec2990 --- /dev/null +++ b/net-irc/quassel/files/quasselcore.init @@ -0,0 +1,62 @@ +#!/sbin/openrc-run +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need localmount net + after bootmisc postgres +} + +CORE="$(which quasselcore)" +PID="/var/run/quassel.pid" +LOGFILE=${LOGFILE:-"/var/log/quassel.log"} +CONFIGDIR=${CONFIGDIR:-"/var/lib/quassel"} +QUASSEL_USER=${QUASSEL_USER:-"quassel"} + +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 + + # 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 +} + +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}" + fi + eend $? +} + +stop() { + ebegin "Stopping Quassel Core" + start-stop-daemon --stop --pidfile "${PID}" --exec "${CORE}" + eend $? +} diff --git a/net-irc/quassel/files/quasselcore.init-r1 b/net-irc/quassel/files/quasselcore.init-r1 new file mode 100644 index 000000000000..5976235aafa4 --- /dev/null +++ b/net-irc/quassel/files/quasselcore.init-r1 @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + after logger postgres +} + +LISTEN=${LISTEN:-"0.0.0.0"} +LOGLEVEL=${LOGLEVEL:-"Info"} +PORT=${PORT:="4242"} + +command="/usr/bin/quasselcore" +command_args="--configdir=/var/lib/quassel + --listen=${LISTEN} + --loglevel=${LOGLEVEL} + --port=${PORT} + --syslog" +command_background="yes" +command_user="quassel" +description="Quassel Core" +pidfile="/run/quassel.pid" diff --git a/net-irc/quassel/files/quasselcore.service b/net-irc/quassel/files/quasselcore.service new file mode 100644 index 000000000000..f5b49ab0373b --- /dev/null +++ b/net-irc/quassel/files/quasselcore.service @@ -0,0 +1,11 @@ +[Unit] +Description=Quassel Core +After=network.target + +[Service] +User=quassel +Group=quassel +ExecStart=/usr/bin/quasselcore --configdir=/var/lib/quassel + +[Install] +WantedBy=multi-user.target |