Created attachment 537454 [details] propose script to do the job current openrc init script for unifi doesn't wait for service shutdown, result in failed service restart # /etc/init.d/unifi restart * Stopping UniFi Controller ... * start-stop-daemon: 1 process refused to stop * Failed to stop UniFi Controller [ !! ] * ERROR: unifi failed to stop # attach my own init script which have some rewritten to handle this for reference
This does seem to work for waiting until the service is fully stopped. We don't need to keep "need net" here, do we? Does this service actually require networking to be up for any reason?
(In reply to Ben Kohler from comment #1) > This does seem to work for waiting until the service is fully stopped. We > don't need to keep "need net" here, do we? Does this service actually > require networking to be up for any reason? that depends, the Controller do have a sub function allow user to control it from UniFi Cloud which provide remote access.
Yes I'm using the cloud access sometimes, but the network can come up any time before or after the unifi service starts, I do not think we need to express a dependency here
(In reply to Ben Kohler from comment #3) > Yes I'm using the cloud access sometimes, but the network can come up any > time before or after the unifi service starts, I do not think we need to > express a dependency here I am fine without it, it's your call, I think it need net.lo for mongod for localhost connection.
Sounds like openrc isn't waiting long enough for unifi to stop Try adding in init.d script: retry="TERM/60"
Many people don't have netifrc & net.lo though-- aren't we allowed to assume the loopback interface is up?
(In reply to Ben Kohler from comment #6) > Many people don't have netifrc & net.lo though-- aren't we allowed to assume > the loopback interface is up? I don't know the correct way to handle this, I do see mysql use that dependency.
I'm going to commit this in -r1 revisions (ebuild bumps, and initd bump), so existing installs see the change, and anyone can roll back to previous if needed. I am committing w/o the net dep for now since I do not think it's required, but we can revisit that later