summaryrefslogtreecommitdiff
path: root/net-irc/quassel-core/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-irc/quassel-core/files')
-rw-r--r--net-irc/quassel-core/files/quassel.logrotate9
-rw-r--r--net-irc/quassel-core/files/quasselcore.conf22
-rw-r--r--net-irc/quassel-core/files/quasselcore.init63
-rw-r--r--net-irc/quassel-core/files/quasselcore.service11
4 files changed, 105 insertions, 0 deletions
diff --git a/net-irc/quassel-core/files/quassel.logrotate b/net-irc/quassel-core/files/quassel.logrotate
new file mode 100644
index 00000000..8e720835
--- /dev/null
+++ b/net-irc/quassel-core/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-core/files/quasselcore.conf b/net-irc/quassel-core/files/quasselcore.conf
new file mode 100644
index 00000000..c6873377
--- /dev/null
+++ b/net-irc/quassel-core/files/quasselcore.conf
@@ -0,0 +1,22 @@
+# 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"
+
+# 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.
+#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" \ No newline at end of file
diff --git a/net-irc/quassel-core/files/quasselcore.init b/net-irc/quassel-core/files/quasselcore.init
new file mode 100644
index 00000000..58aedfa5
--- /dev/null
+++ b/net-irc/quassel-core/files/quasselcore.init
@@ -0,0 +1,63 @@
+#!/sbin/runscript
+# 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
+ 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-core/files/quasselcore.service b/net-irc/quassel-core/files/quasselcore.service
new file mode 100644
index 00000000..f5b49ab0
--- /dev/null
+++ b/net-irc/quassel-core/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