a networking service snap like xkcd doesn't wait for the server to be listening

Bug #1474463 reported by Leo Arias
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snappy
Won't Fix
High
Unassigned

Bug Description

I think that installing a service that listens on a port should return until the server is ready listening on that port.
For example, on snappy install xkcd-webserver, after the command finishes we should be able to access the webserver immediately.

According to http://www.freedesktop.org/software/systemd/man/systemd.service.html#Type= the default service type will wait until the service is running. In this xkcd example, systemctl start waits for the service to be running, which means that the main is being executed. But there's still some time between running main and starting the listener on port 80.

Then, if we put in a script a install followed by a get it will fail. We need to add a sleep or poll until the server is running.

IMO, the systemd service file for a network service should wait until the server has been fully started.

Michael Vogt (mvo)
Changed in snappy:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Michael Vogt (mvo) wrote :

This is still the case in Ubuntu Core 16:
$ sudo snap remove xkcd-webserver ; sudo snap install xkcd-webserver ; printf "GET / HTTP/1.0\n\n" |nc -v localhost 80
xkcd-webserver removed
xkcd-webserver (stable) 16.04-6 from 'canonical' installed
nc: connect to localhost port 80 (tcp) failed: Connection refused
nc: connect to localhost port 80 (tcp) failed: Connection refused

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

We removed the "port" feature so I'm marking this as won't fix.

Changed in snappy:
status: Triaged → Won't Fix
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.