improve systemd configuration support

Bug #1643816 reported by Boris Rybalkin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Wishlist
Sergio Schvezov
snapd
Fix Committed
Undecided
Unassigned

Bug Description

I am porting uwsgi systemd config to snap and having some problem. Snap installs correctly while systemd cannot start the service (some other configuration issue). I think uwsgi will notify systemd that it has started and looks like snap daemon does not support Type=notify.

Original config:
---------------------
[Unit]
Description=uWSGI Internal
After=syslog.target

[Service]
;User=platform
ExecStart={{ app_dir }}/uwsgi/bin/uwsgi --ini {{ config_root }}/config/uwsgi/internal.ini
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all
Environment=LD_LIBRARY_PATH={{ app_dir }}/python/lib

[Install]
WantedBy=multi-user.target
---------------------
Which is almost exact copy of the recommended config by uwsgi developers:
http://uwsgi-docs.readthedocs.io/en/latest/Systemd.html

This is snap version:
---------------------
  uwsgi:
    command: uwsgi/bin/uwsgi --ini ${SNAP_COMMON}/config/uwsgi/public.ini
    daemon: simple
    restart-condition: always
    plugs: [network, network-bind]
---------------------

Snap way of defining systemd services seems very limited, is there a way to provide systemd version of the config in snapd?

Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Boris Rybalkin (ribalkin) wrote :

That seems to work, startup failure was reported back correctly.
Snapcraft schema has to be modified as well.

Thanks

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, this will be part of snapd 2.19 scheduled i ~1 week

Changed in snappy:
status: New → Fix Committed
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Indeed, this is a schema-only change in snapcraft.

Changed in snapcraft:
status: New → Triaged
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: Triaged → In Progress
importance: Undecided → Wishlist
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → next
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
Michael Vogt (mvo)
affects: snappy → snapd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.