learningequality / kolibri-server

A performance-boosting access layer for Kolibri with multi-core support and improved caching
4 stars 8 forks source link

System service knows if UWSGI fails, PID file owned by kolibri user #69

Closed benjaoming closed 3 years ago

benjaoming commented 4 years ago

Fixes #68

@jredrejo I'm not sure if this is perfect, as the previous behavior could silently fail to start but also didn't send a SIGKILL to the kolibri

Adding an invalid option to trigger UWSGI failure now behaves like this:

test@kolibri-test:~$ sudo systemctl start kolibri-server
Job for kolibri-server.service failed because the control process exited with error code.
See "systemctl status kolibri-server.service" and "journalctl -xe" for details.
May 04 22:03:38 kolibri-test runuser[9111]: pam_unix(runuser:session): session opened for user test by (uid=0)
May 04 22:03:38 kolibri-test runuser[9111]: pam_unix(runuser:session): session closed for user test
May 04 22:03:38 kolibri-test kolibri-server[9117]: [uWSGI] getting INI configuration from /etc/kolibri/dist/uwsgi.ini
May 04 22:03:38 kolibri-test kolibri-server[9117]: /usr/bin/uwsgi: unrecognized option '--invalid-option'
May 04 22:03:38 kolibri-test kolibri-server[9117]: getopt_long() error
May 04 22:03:38 kolibri-test systemd[1]: kolibri-server.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
May 04 22:03:38 kolibri-test systemd[1]: kolibri-server.service: Killing process 9096 (debconf-communi) with signal SIGKILL.
May 04 22:03:38 kolibri-test systemd[1]: kolibri-server.service: Killing process 9113 (kolibri) with signal SIGKILL.
May 04 22:03:38 kolibri-test systemd[1]: kolibri-server.service: Killing process 9096 (debconf-communi) with signal SIGKILL.
May 04 22:03:38 kolibri-test systemd[1]: kolibri-server.service: Killing process 9113 (kolibri) with signal SIGKILL.
May 04 22:03:38 kolibri-test systemd[1]: kolibri-server.service: Failed with result 'exit-code'.
May 04 22:03:38 kolibri-test systemd[1]: Failed to start A high performance web server setup for Kolibri.

image