I am creating a systemd service for uwsgi using a non root user and virtualenv in raspbian. In this process I am facing some issues -

labapp.service file -

    [Unit]
    Description=uWSGI instance to serve labapp
    After=network.target


    [Service] 
    User=kshivran
    Group=www-data
    WorkingDirectory=/home/kshivran/var/www/lab
    Environment="PATH=/home/kshivran/var/www/lab/labenv/bin"
    ExecStart=/usr/local/bin/uwsgi  --ini /usr/home/kshivran/var/www/lab/labapp_uwsgi.ini

    [Install]
    WantedBy=multi-user.target

labapp.service status -

kshivran@raspberrypi:~ $ sudo systemctl status labapp
● labapp.service - uWSGI instance to serve labapp
   Loaded: loaded (/etc/systemd/system/labapp.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-09-14 16:37:06 IST; 16s ago
 Main PID: 1805 (code=exited, status=1/FAILURE)

Sep 14 16:37:06 raspberrypi systemd[1]: Started uWSGI instance to serve labapp.
Sep 14 16:37:06 raspberrypi systemd[1]: labapp.service: Main process exited, code=exited, status=1/FAILURE
Sep 14 16:37:06 raspberrypi systemd[1]: labapp.service: Unit entered failed state.
Sep 14 16:37:06 raspberrypi systemd[1]: labapp.service: Failed with result 'exit-code'.

uwsgi file -

[uwsgi]

module = wsgi:app

master = true
processes = 5

socket = labapp.sock

chmod-socket = 666

vacuum = true

die-on-term = true

uwsgi file folder with labenv -

kshivran@raspberrypi:~/var/www/lab $ ls

labapp.py  labapp.pyc  labapp_uwsgi.ini  labenv  wsgi.py  wsgi.pyc

can someone help me to resolve this issue?

  • Please show a copy of your labapp.service unit. – Michael Hampton Sep 14 at 13:17
  • Dear Michael I have added the file in question. – Kuldeep Shivran Sep 14 at 13:31
  • Why do you reset the PATH? This should not be necessary. – Michael Hampton Sep 14 at 19:12
  • I was using this for virtualenv path. – Kuldeep Shivran Sep 15 at 8:06
  • I have tried removing that but faced similar issue . – Kuldeep Shivran Sep 15 at 8:06

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.