I have a setup of service which is launched and maintained by SystemD. The service has a dependency on etcd being up and running in the After section of the SystemD script as follows:

Description=Web User Interface - %i
After=etcd2.service nginx-dynamic-proxy.service


ExecStart=/opt/some-service/bin/wui %i
ExecReload=/bin/kill -s USR2 $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID


Unforunately I’ve found when this machine is restarted the some-service application is started before etcd is actually available for to service requests. I’m guessing it’s actually a problem with my hand written etcd service file. Looking at official etcd examples didn’t yeild much. Doesn’t look like etcd2 has many details either. sd_notify protocol isn’t an option, so that leaves an HTTP check.

Does SystemD have an HTTP health check? Doesn’t look like it :-(. The post illudes to a mechnism which would only test if the socket is available but that is a great first step in my opinion.

After reading 0pointer’s article on the watchdog I’m not entirely sure. After checking on NotifyAccess from the manual now I’m really questioning if this is possible. Perhaps I’m approaching the problem entirely incorrectly and should be looking at it through the view of a systemd.socket. Hmm, I’ll have to return to this project some other time.