# service unbound start unbound | * Checking unbound configuration ... [ ok ] unbound | * Starting unbound daemon ... unbound |[1538370182] unbound[28258:0] error: Cannot bind local socket /var/run/unbound/control (No such file or directory) unbound |[1538370182] unbound[28258:0] error: cannot open control interface /var/run/unbound/control 8953 : protocol not supported unbound |[1538370182] unbound[28258:0] fatal error: could not open ports unbound | * start-stop-daemon: failed to start `/usr/sbin/unbound' unbound | * Failed to start unbound daemon [ !! ] unbound | * ERROR: unbound failed to start Simply inserting mkdir -p "$(dirname "$(getconfig control-interface /var/run/unbound/control)")" into /etc/init.d/unbound:start_pre() sorts it nicely.
This doesn't work if "control-interface" is set to an interface which is more common. I tend to reject this. I suggest to use opentmpfiles service, e.g. create /etc/tmpfiles.d/unbound.conf with > d /var/run/unbound 0750 unbound unbound - as content for example.
I've never heard of /etc/tmpfiles.d before, I guess it could work? I don't have opentmpfiles-setup in any of my runlevels though so apparently it may not be a default service in openrc and affected users would still have to hunt down this bug and rc-update.. Fwiw, most other init scripts use 'checkpath' function for this. If that's no longer the appropriate way, should they all be changed too?
opentmpfiles is a default service for some time now. Not sure why it isn't enabled on your system. > Fwiw, most other init scripts use 'checkpath' function for this. If that's no longer the appropriate way, should they all be changed too? It depends: "checkpath" is a OpenRC thing. So especially when the same is needed for systemd I prefer tmpfiles.d solution. In this specific case using checkpath isn't an option because when you have set > control-interface 1.2.3.4 in your config, the mkdir call wouldn't be what you want. In other words: If we do that in runscript we must be 100% sure that it will work for everyone, not just for you who has set a valid path. :)
> opentmpfiles is a default service for some time now. Not sure why it isn't enabled on your system. Apparently it only got pulled in in mid-february while this install is more than a year old, and Gentoo isn't in the habit of silently adding to my startup scripts for me. > In this specific case using checkpath isn't an option because when you have set > >> control-interface 1.2.3.4 > > in your config, the mkdir call wouldn't be what you want. In other words: If we do that in runscript we must be 100% sure that it will work for everyone, not just for you who has set a valid path. :) Fair enough, let's go with tmpfiles then
Closing as INVALID since this issue does not occur with the default configuration.