manage supervisord with php
This commit is contained in:
@@ -21,6 +21,7 @@ RUN \
|
||||
php7-mbstring \
|
||||
php7-json \
|
||||
php7-fileinfo \
|
||||
php7-pcntl \
|
||||
git \
|
||||
tar
|
||||
|
||||
@@ -39,7 +40,6 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY php-fpm.conf /etc/php7/php-fpm.d/ttrss.conf
|
||||
COPY install-db.php /var/lib/tt-rss-install/install-db.php
|
||||
COPY supervisor.conf /var/lib/tt-rss-install/supervisor.conf
|
||||
COPY manage-supervisord.py /var/lib/tt-rss-install/manage-supervisord.py
|
||||
COPY config.php /var/lib/tt-rss/config.php
|
||||
|
||||
RUN \
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import os
|
||||
import signal
|
||||
|
||||
def write_stdout(s):
|
||||
sys.stdout.write(s)
|
||||
sys.stdout.flush()
|
||||
|
||||
def write_stderr(s):
|
||||
sys.stderr.write(s)
|
||||
sys.stderr.flush()
|
||||
|
||||
def main():
|
||||
while 1:
|
||||
write_stdout('READY\n')
|
||||
line = sys.stdin.readline()
|
||||
os.kill(1, signal.SIGTERM)
|
||||
write_stdout('RESULT 2\nOK')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
import sys
|
||||
@@ -29,5 +29,5 @@ stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[eventlistener:quit_on_failure]
|
||||
command=/usr/bin/python /var/lib/tt-rss-install/manage-supervisord.py
|
||||
command=/usr/bin/php7 -r 'chdir("/var/lib/tt-rss"); while (true) { print("READY\n"); readline(); posix_kill(1, SIGTERM); print("RESULT 2\nOK"); }'
|
||||
events=PROCESS_STATE_FATAL
|
||||
|
||||
Reference in New Issue
Block a user