Mercurial > libervia-web
comparison bin/libervia @ 1231:b9a8049ca1ff
bin (libervia): look for twistd3 first:
`twistd3` is now looked first, for the same reason as for backend (see backend commit
0b6d56a8f7e3).
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 27 Dec 2019 13:35:27 +0100 |
parents | 63f7a2bd1d4a |
children | 2ed4e399e1d4 |
comparison
equal
deleted
inserted
replaced
1230:b32b74dfe866 | 1231:b9a8049ca1ff |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 DEBUG="" | 3 DEBUG="" |
4 DAEMON="" | 4 DAEMON="" |
5 PYTHON="python3" | 5 PYTHON="python3" |
6 TWISTD="$(which twistd)" | 6 |
7 # for Python 3, "twistd" is named "twistd3" on some distros, so we check for it first | |
8 TWISTD="$(which twistd3 2>/dev/null)" | |
9 if [ $? -ne 0 ]; then | |
10 TWISTD="$(which twistd 2>/dev/null)" | |
11 fi | |
12 if [ $? -ne 0 ]; then | |
13 printf "Can't find \"twistd\" script, are you sure that Twisted is installed?\n" | |
14 exit 1 | |
15 fi | |
7 | 16 |
8 kill_process() { | 17 kill_process() { |
9 # $1 is the file containing the PID to kill, $2 is the process name | 18 # $1 is the file containing the PID to kill, $2 is the process name |
10 if [ -f $1 ]; then | 19 if [ -f $1 ]; then |
11 PID=`cat $1` | 20 PID=`cat $1` |