Unifi3 port

dweimer dweimer at dweimer.net
Fri Oct 31 15:28:27 UTC 2014


I have been running UniFi manually installing it for a while, I just now 
noticed that there was a port for it, so I decided to give it a try. 
However I can't get it to successfully start. Despite the fact that it 
runs fine from my manual installation.

After some investigating I have found the source of the problem, but 
can't figure out a fix.

the source appears to stem from running it inside a jail:

The mongod instance fails to start after failing to bind to 127.0.0.1, 
and the socket.

2014-10-31T09:42:50.157-0500 [initandlisten] db version v2.6.5
2014-10-31T09:42:50.157-0500 [initandlisten] git version: nogitversion
2014-10-31T09:42:50.157-0500 [initandlisten] OpenSSL version: OpenSSL 
1.0.1j 15 Oct 2014
2014-10-31T09:42:50.157-0500 [initandlisten] build info: FreeBSD 
unifi.dweimer.local 10.0-RELEASE-p9 FreeBSD 10.0-RELEASE-p9 #1 r271669: 
Tue Sep 16 11:12:21 CDT 2014     
dweimer at freebsd.dweimer.local:/jails/devel/ROOT/usr/obj/jails/devel/ROOT/usr/src/sys/GENERIC 
amd64 BOOST_LIB_VERSION=1_49
2014-10-31T09:42:50.157-0500 [initandlisten] allocator: system
2014-10-31T09:42:50.157-0500 [initandlisten] options: { net: { bindIp: 
"127.0.0.1", http: { enabled: false }, port: 27117 }, storage: { dbPath: 
"/usr/local/share/java/unifi/data/db" }, systemLog: { destination: 
"file", logAppend: true, path: "logs/mongod.log" } }
2014-10-31T09:42:50.160-0500 [initandlisten] journal 
dir=/usr/local/share/java/unifi/data/db/journal
2014-10-31T09:42:50.162-0500 [initandlisten] recover : no journal files 
present, no recovery needed
2014-10-31T09:42:50.352-0500 [initandlisten] ERROR: listen(): bind() 
failed errno:13 Permission denied for socket: /tmp/mongodb-27117.sock
2014-10-31T09:42:50.358-0500 [initandlisten] now exiting
2014-10-31T09:42:50.358-0500 [initandlisten] dbexit:

Oddly enough the java process does try to connect to 10.50.20.5:27117, 
though there is a delay, I expect it times out first on 127.0.0.1, then 
the socket before trying this one.

When I run it from my manual installation, the mongod service fails to 
bind to 127.0.0.1, but apparently falls back to the other IPv4 address.

2014-10-31T09:56:59.575-0500 [initandlisten] db version v2.6.5
2014-10-31T09:56:59.575-0500 [initandlisten] git version: nogitversion
2014-10-31T09:56:59.575-0500 [initandlisten] OpenSSL version: OpenSSL 
1.0.1j 15 Oct 2014
2014-10-31T09:56:59.575-0500 [initandlisten] build info: FreeBSD 
unifi.dweimer.local 10.0-RELEASE-p9 FreeBSD 10.0-RELEASE-p9 #1 r271669: 
Tue Sep 16 11:12:21 CDT 2014     
dweimer at freebsd.dweimer.local:/jails/devel/ROOT/usr/obj/jails/devel/ROOT/usr/src/sys/GENERIC 
amd64 BOOST_LIB_VERSION=1_49
2014-10-31T09:56:59.575-0500 [initandlisten] allocator: system
2014-10-31T09:56:59.575-0500 [initandlisten] options: { net: { bindIp: 
"127.0.0.1", http: { enabled: false }, port: 27117 }, storage: { dbPath: 
"/usr/local/unifi/data/db" }, systemLog: { destination: "file", 
logAppend: true, path: "logs/mongod.log" } }
2014-10-31T09:56:59.708-0500 [initandlisten] journal 
dir=/usr/local/unifi/data/db/journal
2014-10-31T09:56:59.709-0500 [initandlisten] recover : no journal files 
present, no recovery needed
2014-10-31T09:57:00.865-0500 [initandlisten] waiting for connections on 
port 27117
2014-10-31T09:57:00.865-0500 [initandlisten] connection accepted from 
10.50.20.2:60829 #1 (1 connection now open)

Anyone have any ideas?

I tried setting

unifi.db.extraargs=--bind_ip 10.50.20.2

In the unifi system.properties file, didn't seem to make a difference.

-- 
Thanks,
    Dean E. Weimer
    http://www.dweimer.net/


More information about the freebsd-questions mailing list