[systemd-devel] Service unit issue: starts manually but doesn't start on boot

Lennart Poettering lennart at poettering.net
Sun Apr 21 08:38:30 PDT 2013


On Fri, 19.04.13 22:01, Peter Li (chinasaurli at gmail.com) wrote:

> On 04/19/2013 04:16 AM, Colin Guthrie wrote:
> <snip>
> >>When I then run `systemctl start wsgw; systemctl status wsgw` I get:
> >>
> >>     wsgw.service - WebSockets Gateway for pianod
> >>           Loaded: loaded (/usr/lib/systemd/system/wsgw.service; enabled)
> >>           Active: active (running) since Thu, 18 Apr 2013 22:09:40
> >>     -0700; 7ms ago
> >>         Main PID: 2565 (wsgw)
> >>           CGroup: name=systemd:/system/wsgw.service
> >>               └ 2565 /usr/sbin/wsgw -p 8000 pianod,localhost,4445,text
> >I suspect that on boot the network or name resolution is not available
> >and your service is started "too soon".
> <snip>
> 
> Thanks for your reply.  I'm now pretty sure the issue is that the
> service calls getaddrinfo(...) when it starts, and that returns
> EAI_NONAME if this is run too early in boot.  But I've now tried
> adding After=network.target and that doesn't seem to help; is there
> something else I need to wait for so that getaddrinfo() will
> succeed?

On Fedora "systemctl enable NetworkManager-wait-online.service" might
help. For a longer explanation see:

http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

However, it might be worth figuring out why it calls getaddrinfo() at
start-up. That already looks wrong and fragile. If you can fix that,
then you don't have to make your boot dependent on unreliable external
factors via NM-w-o.s.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list