#58844 closed defect (fixed)

Unbound does not start after reboot, but it does start when started by hand with port reload unbound

Reported by: gctwnl Owned by: nerdling (Jeremy Lavergne)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: jmroot (Joshua Root)
Port: unbound

Description

I'm using unbound. The (daemondo / wrapper based) startupitem des launch, but unbound doesn't start.

    0    75     1   0  20  0  4362300   5392 -      Ss     ??    0:00.01 /opt/local/bin/daemondo --label=unbound --start-cmd /opt/local/etc/LaunchDaemons/org.macports.unbound/unbound.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.unbound/unbound.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.unbound/unbound.wrapper restart ; --verbosity=1 --pid=none
  501   611   507   0  31  0  4268080    828 -      S+   s003    0:00.00 grep unbound

While the nsd startupitem I created in exactly the same way does lead to a running nsd:

    0    69     1   0  20  0  4345916   5388 -      Ss     ??    0:00.01 /opt/local/bin/daemondo --label=nsd --start-cmd /opt/local/etc/LaunchDaemons/org.macports.nsd/nsd.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.nsd/nsd.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.nsd/nsd.wrapper restart ; --verbosity=1 --pid=none
  503   214     1   0  20  0  4440260  83420 -      Ss     ??    0:00.04 /opt/local/sbin/nsd
  503   216   214   0  20  0  4355856    972 -      S      ??    0:00.00 /opt/local/sbin/nsd
  503   220   216   0  20  0  4355988    588 -      S      ??    0:00.00 /opt/local/sbin/nsd
  501   630   478   0  31  0  4268080    828 -      S+   s000    0:00.00 grep nsd

After a reload, unbound runs:

Albus:~ sysbh$ sudo port reload unbound
--->  Reloading startupitem 'unbound' for unbound
Albus:~ sysbh$ ps laxww|grep unbound
    0   706     1   0  20  0  4306504   5224 -      Ss     ??    0:00.01 /opt/local/bin/daemondo --label=unbound --start-cmd /opt/local/etc/LaunchDaemons/org.macports.unbound/unbound.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.unbound/unbound.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.unbound/unbound.wrapper restart ; --verbosity=1 --pid=none
  500   711     1   0  20  0  4328068  17260 -      Ss     ??    0:00.02 /opt/local/sbin/unbound
  501   714   478   0  31  0  4277296    856 -      S+   s000    0:00.00 grep unbound

Mojave

Change History (5)

comment:1 Changed 14 months ago by mf2k (Frank Schima)

In the future, please add the port maintainer(s) to Cc (port info --maintainers unbound), if any.

comment:2 Changed 14 months ago by mf2k (Frank Schima)

Owner: set to nerdling
Status: newassigned

comment:3 Changed 14 months ago by gctwnl

Additional info I was able to coax some error messages from launchd:

2019-08-16 16:53:59 unbound: Starting process
2019-08-16 16:53:59 unbound: Running start-cmd /opt/local/etc/LaunchDaemons/org.macports.unbound/unbound.wrapper start
Aug 16 16:54:00 unbound-albus[219:0] error: can't bind socket: Can't assign requested address for 192.168.2.66 port 53
Aug 16 16:54:00 unbound-albus[219:0] fatal error: could not open ports

by changing the Startup call in the wrapper to

(/opt/local/sbin/unbound-anchor -a /opt/local/etc/unbound/root.key 2>&1) || : && (chown unbound:unbound /opt/local/etc/unbound/root.key 2>&1) && (/opt/local/sbin/unbound 2>&1)

(stdout is faithfully reported by launchd, stderr is a black hole)

It seems the wrapper runs without proper authorisation (i.e. root) or the port has already been taken. The latter is not the case (no after boot anyway, during boot it is highly unlikely). Still investigating. I've tried with only the unbound binary start, no difference, so it's not the && part sof the shell statement.

comment:4 Changed 14 months ago by gctwnl

I have solved (found a workaround) and submitted my first pull request (which was a bit of a frustrating experience, being so inexperienced with git and all that)

https://github.com/macports/macports-ports/pull/5032

comment:5 Changed 14 months ago by nerdling (Jeremy Lavergne)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.