summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2007-11-19 13:56:54 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2007-11-19 13:56:54 +0000
commit7952bf38bba7f17cf47bdf0a2017b74722ea1af5 (patch)
tree129e82c1df7f945bf7e001a84b15db28399069bb /net-irc/rbot/files
parentAdd snapshot USE flag for the rbot live ebuild. (diff)
downloadhistorical-7952bf38bba7f17cf47bdf0a2017b74722ea1af5.tar.gz
historical-7952bf38bba7f17cf47bdf0a2017b74722ea1af5.tar.bz2
historical-7952bf38bba7f17cf47bdf0a2017b74722ea1af5.zip
Take maintainership again, and add the live SVN ebuild I had in my overlay. More development will follow.
Package-Manager: portage-2.1.3.19
Diffstat (limited to 'net-irc/rbot/files')
-rw-r--r--net-irc/rbot/files/digest-rbot-9999-r30
-rw-r--r--net-irc/rbot/files/rbot.conf22
-rw-r--r--net-irc/rbot/files/rbot.init55
3 files changed, 77 insertions, 0 deletions
diff --git a/net-irc/rbot/files/digest-rbot-9999-r3 b/net-irc/rbot/files/digest-rbot-9999-r3
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/net-irc/rbot/files/digest-rbot-9999-r3
diff --git a/net-irc/rbot/files/rbot.conf b/net-irc/rbot/files/rbot.conf
new file mode 100644
index 000000000000..0c22544f385a
--- /dev/null
+++ b/net-irc/rbot/files/rbot.conf
@@ -0,0 +1,22 @@
+# Configuration file for rbot service(s)
+#
+# To allow running more than one rbot service on your box, you can
+# symlink /etc/init.d/rbot to any name starting with rbot.
+# By doing this, after this configuration file, the service will
+# source the relative /etc/conf.d/rbot.$name file, where you can set
+# your particular configuration for that rbot instance.
+#
+# NOTE: please make sure you always use a different RBOTDIR for
+# multiple instances; you can still use the same user though.
+# Also note that, as in the home of the user there will be the
+# password for both rbot and NickServ access, the directory should not
+# have world readable permissions.
+
+# Base directory for the bot, with the configuration data
+RBOTDIR="/var/lib/rbot"
+
+# User to run the rbot instance with.
+# Note 1: you can specify also a group in the form of user:group.
+# Note 2: the HOME of the user will be hardwired to /dev/null for
+# safety.
+RBOTUSER="rbot:nobody"
diff --git a/net-irc/rbot/files/rbot.init b/net-irc/rbot/files/rbot.init
new file mode 100644
index 000000000000..a308d5c8e3d5
--- /dev/null
+++ b/net-irc/rbot/files/rbot.init
@@ -0,0 +1,55 @@
+#!/sbin/runscript
+# Copyright 2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/files/rbot.init,v 1.1 2007/11/19 13:56:54 flameeyes Exp $
+
+depend() {
+ need net
+ use dns
+}
+
+start() {
+ if ! [ -d "${RBOTDIR}" ]; then
+ eerror "The path you specified (${RBOTDIR}) is not a directory."
+ eerror "Please set RBOTDIR variable in /etc/conf.d/${myservice}"
+ eerror "to a proper value for an rbot base directory."
+ return 1
+ fi
+
+ if ! [ -f "${RBOTDIR}/conf.yaml" ]; then
+ eerror "You didn't configure rbot yet. Please configure rbot by running"
+ eerror " rbot ${RBOTDIR}"
+ eerror "at least once."
+ return 1
+ fi
+
+ # for a series of reason, we can't rely on the process being started
+ # with 'ruby' name. As using ruby18 would break for ruby 1.9, get the
+ # linked name to use as rubyname.
+ ruby="$(readlink /usr/bin/ruby)"
+
+ export USER="${RBOTUSER%%:*}"
+ export HOME="/dev/null"
+ ebegin "Starting rbot"
+ start-stop-daemon \
+ --start \
+ --exec "/usr/bin/${ruby}" --name "${ruby}" \
+ --pidfile "${RBOTDIR}/rbot.pid" \
+ --chuid "${RBOTUSER}" \
+ -- /usr/bin/rbot --background "${RBOTDIR}"
+ eend $?
+}
+
+stop() {
+ # for a series of reason, we can't rely on the process being started
+ # with 'ruby' name. As using ruby18 would break for ruby 1.9, get the
+ # linked name to use as rubyname.
+ ruby="$(readlink /usr/bin/ruby)"
+
+ ebegin "Stopping rbot"
+ start-stop-daemon --stop \
+ --exec "/usr/bin/${ruby}" \
+ --pidfile "${RBOTDIR}/rbot.pid" \
+ --user "${RBOTUSER%%:*}"
+ eend $?
+}