Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 659420 - net-wireless/unifi require better openrc init script to proper waiting for shutdown
Summary: net-wireless/unifi require better openrc init script to proper waiting for sh...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Ben Kohler
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-27 18:32 UTC by andcycle-gentoo
Modified: 2018-06-29 14:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
propose script to do the job (unifi.initd,673 bytes, text/plain)
2018-06-27 18:32 UTC, andcycle-gentoo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andcycle-gentoo 2018-06-27 18:32:52 UTC
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
Comment 1 Ben Kohler gentoo-dev 2018-06-28 17:23:40 UTC
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?
Comment 2 andcycle-gentoo 2018-06-28 17:36:10 UTC
(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.
Comment 3 Ben Kohler gentoo-dev 2018-06-28 17:37:39 UTC
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
Comment 4 andcycle-gentoo 2018-06-28 17:40:30 UTC
(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.
Comment 5 Joakim Tjernlund 2018-06-28 17:43:00 UTC
Sounds like openrc isn't waiting long enough for unifi to stop
Try adding in init.d script:
   retry="TERM/60"
Comment 6 Ben Kohler gentoo-dev 2018-06-28 17:44:11 UTC
Many people don't have netifrc & net.lo though-- aren't we allowed to assume the loopback interface is up?
Comment 7 andcycle-gentoo 2018-06-28 17:47:19 UTC
(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.
Comment 8 Ben Kohler gentoo-dev 2018-06-29 13:35:44 UTC
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