-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
52 lines (41 loc) · 1.06 KB
/
setup.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
#!/bin/bash
python setup.py install
function create_service() {
echo "Creating service $1"
touch /etc/systemd/system/$1.service
chmod 664 /etc/systemd/system/$1.service
cat << SERVICE > /etc/systemd/system/$1.service
[Unit]
Description=$1
After=network.target redis.service mariadb.service
[Service]
ExecStart=$2
Type=simple
[Install]
WantedBy=default.target
SERVICE
}
function create_uwsgi_service() {
echo "Creating service $1"
touch /etc/systemd/system/$1.service
chmod 664 /etc/systemd/system/$1.service
cat << SERVICE > /etc/systemd/system/$1.service
[Unit]
Description=$1
After=network.target redis.service mariadb.service
[Service]
ExecStart=/usr/sbin/uwsgi --ini $2
RuntimeDirectory=uwsgi
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all
[Install]
WantedBy=default.target
SERVICE
}
create_service s8 "/usr/bin/python $(pwd)/s8.py"
create_service a8 "/usr/bin/python $(pwd)/a8.py"
create_service p8 "/usr/bin/python $(pwd)/p8.py"
create_uwsgi_service w8 "$(pwd)/w8.ini"