christgau / wsdd

A Web Service Discovery host daemon.
MIT License
861 stars 101 forks source link

WSDD is inactive (dead) after boot but starts with manual systemctl start wsdd #135

Closed martyfour closed 2 years ago

martyfour commented 2 years ago

I have used WSDD successfully in the past (and it works great!) but at some point it stopped working at boot. I run Ubuntu 20.04 and use repository so currently on 0-7 and have system has been upgraded over time. The service status after boot shows: ● wsdd.service - Web Services Dynamic Discovery host daemon Loaded: loaded (/etc/systemd/system/wsdd.service; disabled; vendor preset:> Active: inactive (dead) Docs: man:wsdd(8) Nothing in log.

If I start in manually (with logging at INFO) I get 2022-04-12 22:22:28,882:wsdd WARNING(pid 35540): no interface given, using all interfaces wsdd INFO(pid 35540): using pre-defined UUID 11cb31b7-312a-53b1-a954-2dc44508a9d5 wsdd INFO(pid 35540): chrooted successfully to /run/wsdd wsdd INFO(pid 35540): joined multicast group ('239.255.255.250', 3702) on 192.168.60.10%enp9s0 wsdd INFO(pid 35540): joined multicast group ('239.255.255.250', 3702) on 10.8.0.1%tun0 wsdd INFO(pid 35540): 192.168.60.6 - - "POST /11cb31b7-312a-53b1-a954-2dc44508a9d5 HTTP/1.1" 200 - wsdd INFO(pid 35540): 192.168.60.6 - - "POST /11cb31b7-312a-53b1-a954-2dc44508a9d5 HTTP/1.1" 200 -

The service file in /etc/systemd/system is:

[Unit] Description=Web Services Dynamic Discovery host daemon Documentation=man:wsdd(8) ; Start after the network has been configured After=network-online.target Wants=network-online.target ; It makes sense to have Samba running when wsdd starts, but is not required. ; Thus, the next to lines are disabled and use BindsTo only. ; One may also add any of these services to After for stronger binding. ;BindsTo=smb.service ;BindsTo=samba.service

[Service] Type=simple EnvironmentFile=/etc/default/wsdd ; The service is put into an empty runtime directory chroot, ; i.e. the runtime directory which usually resides under /run ExecStart=/usr/bin/wsdd -4 -v --chroot=/run/wsdd $WSDD_PARAMS DynamicUser=yes User=wsdd Group=wsdd RuntimeDirectory=wsdd AmbientCapabilities=CAP_SYS_CHROOT

[Install] WantedBy=multi-user.target

with a null wsdd.defaults:

Additional arguments for wsdd can be provided here.

Use, e.g., "-i eth0" to restrict operations to a specific interface

Refer to the wsdd(8) man page for details

WSDD_PARAMS=""

Any thoughts as to what I can do to fix this?

Many thanks, Martin

JedMeister commented 2 years ago

See in the second line of your systemctl output:

/etc/systemd/system/wsdd.service; disabled;

That suggests the service isn't enabled (no idea how that could have happened without someone explicitly doing it, but anyway...). Try just re-enabling it and reboot and see if that fixes it:

systemctl enable wsdd.service
reboot

Hopefully it should automatically start when it comes back up.


PS FWIW putting command output and config file contents within code blocks (so it renders monospace and minimal formatting) makes it much easier to read. Check out this cheatsheet for formatting tips.

martyfour commented 2 years ago

Hi Jed, I tried your solution and it worked! Like you I have no idea how the service became disabled, but I must have done it at some poiint - but that will teach me not to question every assumption :-) My problem solved and I've learnt something (and I will read the cheatsheet) - many thanks to you and this wonderful community.