Gentoo Archives: gentoo-commits

From: "Alex Legler (a3li)" <a3li@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-irc/rbot/files: rbot.init2 rbot.conf2
Date: Wed, 28 Jul 2010 07:58:14
Message-Id: 20100728075809.51F0D2CE15@corvid.gentoo.org
1 a3li 10/07/28 07:58:09
2
3 Added: rbot.init2 rbot.conf2
4 Log:
5 Version bump, closes bug 330125 by Jens Pranaitis. Ebuild now uses the ruby-ng eclass. Adds support for specifying a Ruby interpreter for rbot. Add fi to LINGUAS.
6 (Portage version: 2.2_rc67/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 net-irc/rbot/files/rbot.init2
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/rbot/files/rbot.init2?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/rbot/files/rbot.init2?rev=1.1&content-type=text/plain
13
14 Index: rbot.init2
15 ===================================================================
16 #!/sbin/runscript
17 # Copyright 1999-2010 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/files/rbot.init2,v 1.1 2010/07/28 07:58:08 a3li Exp $
20
21 depend() {
22 need net
23 use dns
24 }
25
26 start() {
27 if ! [ -d "${RBOTDIR}" ]; then
28 eerror "The path you specified (${RBOTDIR}) is not a directory."
29 eerror "Please set RBOTDIR variable in /etc/conf.d/${SVCNAME}"
30 eerror "to a proper value for an rbot base directory."
31 return 1
32 fi
33
34 if ! [ -f "${RBOTDIR}/conf.yaml" ]; then
35 eerror "You didn't configure rbot yet. Please configure rbot by running"
36 eerror " rbot ${RBOTDIR}"
37 eerror "at least once."
38 return 1
39 fi
40
41 if ! [ -x "${RBOTRUBY}" ]; then
42 eerror "The configured Ruby interpreter for rbot is not an executable."
43 eerror "Use \`eselect ruby' to set a default interpreter or adapt the"
44 eerror "RBOTRUBY variable in /etc/conf.d/${SVCNAME}."
45 return 1
46 fi
47
48 export USER="${RBOTUSER%%:*}"
49 export HOME="/dev/null"
50 ebegin "Starting rbot"
51 start-stop-daemon \
52 --start \
53 --exec "${RBOTRUBY}" --name "$(basename ${RBOTRUBY})" \
54 --pidfile "${RBOTDIR}/rbot.pid" \
55 --chuid "${RBOTUSER}" \
56 -- /usr/bin/rbot --background "${RBOTDIR}"
57 eend $?
58 }
59
60 stop() {
61 ebegin "Stopping rbot"
62 start-stop-daemon --stop \
63 --exec "${RBOTRUBY}" \
64 --pidfile "${RBOTDIR}/rbot.pid" \
65 --user "${RBOTUSER%%:*}"
66 eend $?
67 }
68
69 # vim:set sts=8 sw=8 ts=8 noexpandtab:
70
71
72
73 1.1 net-irc/rbot/files/rbot.conf2
74
75 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/rbot/files/rbot.conf2?rev=1.1&view=markup
76 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/rbot/files/rbot.conf2?rev=1.1&content-type=text/plain
77
78 Index: rbot.conf2
79 ===================================================================
80 # Configuration file for rbot service(s)
81 #
82 # To allow running more than one rbot service on your box, you can
83 # symlink /etc/init.d/rbot to any name starting with rbot.
84 # By doing this, after this configuration file, the service will
85 # source the relative /etc/conf.d/rbot.$name file, where you can set
86 # your particular configuration for that rbot instance.
87 #
88 # NOTE: please make sure you always use a different RBOTDIR for
89 # multiple instances; you can still use the same user though.
90 # Also note that, as in the home of the user there will be the
91 # password for both rbot and NickServ access, the directory should not
92 # have world readable permissions.
93
94 # Base directory for the bot, with the configuration data
95 RBOTDIR="/var/lib/rbot"
96
97 # User to run the rbot instance with.
98 # Note 1: you can specify also a group in the form of user:group.
99 # Note 2: the HOME of the user will be hardwired to /dev/null for
100 # safety.
101 RBOTUSER="rbot:nobody"
102
103 # The Ruby interpreter to run rbot with. Use full paths.
104 # This defaults to whatever is put as default by eselect ruby.
105 RBOTRUBY="/usr/bin/$(readlink /usr/bin/ruby)"