canonical / core18

The core18 base snap
14 stars 26 forks source link

run-snapd-from-core: fix race when restarting snapd.socket #96

Closed mvo5 closed 5 years ago

mvo5 commented 5 years ago

In the early core18 bootstrap there is no systemd owned snapd.socket. The snapd daemon starts and creates this socket itself. However when snapd restarts itself golang will remove this socket (we have no control over this).

This may mean that the snapd.seeded job has the wrong socket open (the socket that was owned by the bootstraping snapd) and because there is no snapd anymore behind this socket the snapd.seeded service fails.

To fix this the snapd.seeded service is also restarted after the snapd.socket gets restarts. This ensures that the snapd.seeded service will watch the right socket.

sergiocazzolato commented 5 years ago

@mvo5 this is validated, thanks for this PR