Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 839342 - net-wireless/unifi should use system mongodb and (systemd-) service
Summary: net-wireless/unifi should use system mongodb and (systemd-) service
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Conrad Kostecki
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-18 19:12 UTC by Dennis Lamm
Modified: 2022-04-29 09:24 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Lamm gentoo-dev 2022-04-18 19:12:23 UTC
Currently unifi starts mongodb with the symlink from bin/mongodb. This approach has several drawbacks.


It is also possible to use the system mongodb startet as a system service. Which could be achieved with the following steps:

1. replace bin/mongodb from unifi directory with symlink to '/dev/null'

2. Move database from 'data/db' to mongo db path, usually '/var/lib/mongodb' and change ownership of the files to 'mongodb'

3. Start mongodb via systemd

4. Add to 'data/system.properties':
db.mongo.local=false
db.mongo.uri=mongodb\://127.0.0.1\:27017/ace
statdb.mongo.uri=mongodb\://127.0.0.1\:27017/ace_stat
unifi.db.name=ace

5. Start unifi service it should work as expected.

6. Modify SystemD Service unit to depend on mongodb


Reproducible: Always
Comment 1 Conrad Kostecki gentoo-dev 2022-04-18 19:41:51 UTC
Sorry, but I am going to say NACK here. Such configuration is officially not supported by upstream and I do want to stick to upstream default behauvior.

The only thing, I guess, we could do, would be some additional use flag 'external-mongodb', which does symlink mongodb to null, so you can use your own service for mongodb.
Comment 2 Dennis Lamm gentoo-dev 2022-04-19 03:44:29 UTC
The possibility is given by the official UI-TEAM here https://community.ui.com/questions/External-MongoDB-Server/d311a8f8-43b6-4aeb-859d-eefec9dc1bbc?page=3.
Comment 3 Dennis Lamm gentoo-dev 2022-04-20 18:29:19 UTC
When introducing a 'system mongodb' use flag is it possible to get this behaviour:

1. to add the dependency in the systemd service file for mongodb
2. to add the necessary entries to data/system.properties
3. not create the mongodb symlink or remove it
Comment 4 Conrad Kostecki gentoo-dev 2022-04-21 19:05:46 UTC
IMHO possible, if controlled by a separate use flag and not being default, I would ack.

If you have something, PR are welcome. I am currently on holiday, so can't to anything for the next two weeks.
Comment 5 Conrad Kostecki gentoo-dev 2022-04-29 09:24:25 UTC
In tree.