Skip to content

Commit 224f586

Browse files
author
root
committed
Add drupal bot and scripts.
1 parent 6792c68 commit 224f586

File tree

1,078 files changed

+318169
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,078 files changed

+318169
-0
lines changed

bot

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#! /bin/sh
2+
### BEGIN INIT INFO
3+
# Provides: bot
4+
# Required-Start: $local_fs $remote_fs
5+
# Required-Stop: $local_fs $remote_fs
6+
# Default-Start: 2 3 4 5
7+
# Default-Stop: S 0 1 6
8+
# Short-Description: Example initscript
9+
# Description: Drupalfr Bot.
10+
### END INIT INFO
11+
12+
# Author: Damien Tournoud <[email protected]>
13+
14+
# Do NOT "set -e"
15+
16+
# PATH should only include /usr/* if it runs after the mountnfs.sh script
17+
PATH=/usr/sbin:/usr/bin:/sbin:/bin
18+
DESC="Drupalfr IRC bot"
19+
NAME=drupalfr_bot
20+
DAEMON=/usr/bin/php5
21+
DAEMON_ARGS="/home/drupalfr_bot/www/sites/default/modules/bot/bot_start.php --root /home/drupalfr_bot/www --url http://bot.drupalfr.org"
22+
PIDFILE=/var/run/$NAME.pid
23+
SCRIPTNAME=/etc/init.d/$NAME
24+
25+
# Exit if the package is not installed
26+
[ -x "$DAEMON" ] || exit 0
27+
28+
# Read configuration variable file if it is present
29+
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
30+
31+
# Load the VERBOSE setting and other rcS variables
32+
[ -f /etc/default/rcS ] && . /etc/default/rcS
33+
34+
# Define LSB log_* functions.
35+
. /lib/lsb/init-functions
36+
37+
do_start()
38+
{
39+
start-stop-daemon --start --quiet --background --make-pidfile --chuid nobody:nogroup --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
40+
|| return 1
41+
start-stop-daemon --start --quiet --background --make-pidfile --chuid nobody:nogroup --pidfile $PIDFILE --exec $DAEMON -- \
42+
$DAEMON_ARGS \
43+
|| return 2
44+
}
45+
46+
do_stop()
47+
{
48+
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
49+
RETVAL="$?"
50+
rm -f $PIDFILE
51+
return "$RETVAL"
52+
}
53+
54+
case "$1" in
55+
start)
56+
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
57+
do_start
58+
case "$?" in
59+
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
60+
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
61+
esac
62+
;;
63+
stop)
64+
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
65+
do_stop
66+
case "$?" in
67+
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
68+
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
69+
esac
70+
;;
71+
restart|force-reload)
72+
#
73+
# If the "reload" option is implemented then remove the
74+
# 'force-reload' alias
75+
#
76+
log_daemon_msg "Restarting $DESC" "$NAME"
77+
do_stop
78+
case "$?" in
79+
0|1)
80+
do_start
81+
case "$?" in
82+
0) log_end_msg 0 ;;
83+
1) log_end_msg 1 ;; # Old process is still running
84+
*) log_end_msg 1 ;; # Failed to start
85+
esac
86+
;;
87+
*)
88+
# Failed to stop
89+
log_end_msg 1
90+
;;
91+
esac
92+
;;
93+
*)
94+
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
95+
exit 3
96+
;;
97+
esac
98+
99+
:

conf/apache.conf

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<VirtualHost *:8080>
2+
ServerName bot.drupalfr.org
3+
DocumentRoot /home/drupalfr_bot/www
4+
5+
<Directory />
6+
Options FollowSymLinks
7+
AllowOverride None
8+
</Directory>
9+
<Directory /home/drupalfr_bot/www>
10+
Options -Indexes FollowSymLinks MultiViews
11+
AllowOverride All
12+
Order allow,deny
13+
allow from all
14+
</Directory>
15+
16+
ErrorLog /home/drupalfr_bot/logs/error.log
17+
LogLevel warn
18+
CustomLog /home/drupalfr_bot/logs/access.log combined
19+
ServerSignature On
20+
</VirtualHost>

start_bot.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
/sbin/start-stop-daemon --stop -v --pidfile /var/run/drupalfr_bot.pid
4+
/sbin/start-stop-daemon --start -v --exec /usr/bin/php5 -p /var/run/drupalfr_bot.pid --background --make-pidfile --chuid nobody:nogroup -- /srv/master/drupalfr_bot/www/sites/all/modules/bot/bot_start.php --root /srv/master/drupalfr_bot/www --url http://bot.drupalfr.org

www/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore configuration files that may contain sensitive information.
2+
sites/*/settings*.php
3+
4+
# Ignore paths that contain user-generated content.
5+
sites/*/files
6+
sites/*/private

0 commit comments

Comments
 (0)