summaryrefslogtreecommitdiff
path: root/server/gentoo
diff options
context:
space:
mode:
Diffstat (limited to 'server/gentoo')
-rw-r--r--server/gentoo/init.d/Makefile.am7
-rwxr-xr-xserver/gentoo/init.d/pracrod.in44
-rw-r--r--server/gentoo/logrotate.d/Makefile.am7
-rw-r--r--server/gentoo/logrotate.d/pracrod15
4 files changed, 73 insertions, 0 deletions
diff --git a/server/gentoo/init.d/Makefile.am b/server/gentoo/init.d/Makefile.am
new file mode 100644
index 0000000..9056326
--- /dev/null
+++ b/server/gentoo/init.d/Makefile.am
@@ -0,0 +1,7 @@
+EXTRA_DIST = \
+ pracrod.in
+
+initddir=${prefix}/etc/init.d
+
+dist_initd_SCRIPTS = \
+ pracrod
diff --git a/server/gentoo/init.d/pracrod.in b/server/gentoo/init.d/pracrod.in
new file mode 100755
index 0000000..e226a9b
--- /dev/null
+++ b/server/gentoo/init.d/pracrod.in
@@ -0,0 +1,44 @@
+#!/sbin/runscript
+# -*- shell-script -*-
+# Copyright 2010 Bent Bisballe Nyeng (deva@aasimon.org)
+# Distributed under the terms of the GNU General Public License v2
+
+_PROG="pracrod"
+_PREFIX="@prefix@"
+_CONF="${_PREFIX}/etc/pracrod.conf"
+_BIN="${_PREFIX}/bin/pracrod"
+_XML="${_PREFIX}/xml"
+_LOG="/var/log/pracrod.log"
+
+depend() {
+ need net
+ need postgresql
+# provide pracrod
+}
+
+checkconfig() {
+ if [ ! -f ${_CONF} ] ; then
+ eerror "Please create ${_CONF}. Take a look at ${_CONF}.example"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return $?
+
+ ebegin "Starting ${_PROG}"
+ start-stop-daemon --start --exec ${_BIN} \
+ --pidfile /var/run/${_PROG}.pid \
+ -- --pidfile /var/run/${_PROG}.pid --config ${_CONF} \
+ --xml-basedir ${_XML} -D +fixme,+err,+warn,+info --logfile ${_LOG}
+ eend $? "Failed to start ${_PROG}"
+}
+
+stop() {
+ ebegin "Stopping ${_PROG}"
+ start-stop-daemon --stop -s INT \
+ --pidfile /var/run/${_PROG}.pid \
+ --exec ${_BIN}
+ eend $? "Failed to stop ${_PROG}"
+}
diff --git a/server/gentoo/logrotate.d/Makefile.am b/server/gentoo/logrotate.d/Makefile.am
new file mode 100644
index 0000000..64fcb53
--- /dev/null
+++ b/server/gentoo/logrotate.d/Makefile.am
@@ -0,0 +1,7 @@
+EXTRA_DIST = \
+ pracrod
+
+logrotatedir=${prefix}/etc/logrotate.d
+
+dist_logrotate_SCRIPTS = \
+ pracrod
diff --git a/server/gentoo/logrotate.d/pracrod b/server/gentoo/logrotate.d/pracrod
new file mode 100644
index 0000000..eab5a82
--- /dev/null
+++ b/server/gentoo/logrotate.d/pracrod
@@ -0,0 +1,15 @@
+# -*- shell-script -*-
+# Copyright 2010 Bent Bisballe Nyeng
+# Distributed under the terms of the GNU General Public License v2
+
+/var/log/pracrod.log {
+ weekly
+ #create 660 root root
+ notifempty
+ size 5M
+ sharedscripts
+ missingok
+ postrotate
+ /bin/kill -s SIGHUP `cat /var/run/pracrod.pid`
+ endscript
+}