forked from TechXueXi/TechXueXi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
supervisor.sh
58 lines (44 loc) · 1.27 KB
/
supervisor.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
# apt-get install supervisor
echo_supervisord_conf > /etc/supervisord.conf
sed -i -e 's/^file=\/tmp/file=\/var\/run/' \
-e 's/^logfile=\/tmp/logfile=\/var\/log/' \
-e 's/^pidfile=\/tmp/pidfile=\/var\/run/' \
-e 's/^serverurl=unix:\/\/\/tmp/serverurl=unix:\/\/\/var\/run/' \
/etc/supervisord.conf
cat >> /etc/supervisord.conf <<EOF
[program:xuexiwechat]
directory=/xuexi
user=root
command=/usr/local/bin/python wechatListener.py
autostart=false
autorestart=true
stdout_logfile=/xuexi/user/wechat_listener.log
stderr_logfile=/xuexi/user/wechat_listener.log
EOF
cat >> /etc/supervisord.conf <<EOF
[program:xuexitg]
directory=/xuexi
user=root
command=/usr/local/bin/python telegramListener.py
autostart=false
autorestart=true
stdout_logfile=/xuexi/user/tg_listener.log
stderr_logfile=/xuexi/user/tg_listener.log
EOF
cat >> /etc/supervisord.conf <<EOF
[program:xuexiweb]
directory=/xuexi
user=root
command=/usr/local/bin/python webserverListener.py
autostart=false
autorestart=true
stdout_logfile=/xuexi/user/web_listener.log
stderr_logfile=/xuexi/user/web_listener.log
EOF
mkdir -p /xuexi/user
cp -r /etc/supervisord.conf /xuexi/user/
#systemctl enable supervisord
#supervisorctl stop all
#supervisord -c /xuexi/user/supervisord.conf
#supervisorctl start all