EMQ fails to start if run under a different linux user than that which first ran it #842

marriotb opened this Issue Jan 2, 2017 · 1 comment


None yet

3 participants

marriotb commented Jan 2, 2017


  • OS: Linux: Ubuntu 16.04 LTS (Xenial Xerus)
  • Erlang/OTP: 7.3
  • EMQ: 2.0.5



I installed EMQ on Ubuntu 16.04 successfully from the 2.0.5 download zip file. It ran fine in both console mode and daemon (./bin/emqttd start) mode, using my normal working Linux userid, and responded appropriately to ./bin/emqttd stop command. So I set up a dedicated linux userid for the daemon to run under and changed the permissions of the emqttd directory appropriately.


I could not get it to start under that userid. It would run in console mode but not as a daemon😖.

Diagnostic information

No error messages were being logged to the ./log directory, and the only process that would start was ./erts-7.3/bin/epmd -daemon. A status query via ./bin/emqttd_ctl simply reported that it wasn't responding to pings.

Initial Resolution

I eventually located a permissions error being logged to the syslog. (run_erl[nnn]: errno=13 'Permission denied'#012Cannot create FIFO /tmp/erl_pipes/emqttd@ for writing.)
Attempts to open files in /tmp/erl_pipes/emqttd@ were failing, as this directory existed and was owned by the userid that I had initially used to test-run the software.

Removing that directory provides a work-around for the issue😌.

Suggested enhancement

It looks to me as if ./erts-7.3/bin/run_erl is creating the FIFO directory, but not removing it on exit. This may be by design, as a start-up efficiency measure, or by accident, simply being missed in the clean-up code.

If the latter, the fix is obvious. If the former, it may be enough to catch the error on creation of the FIFO and report it into the crash.log. The frequency of occurrence isn't such that it requires significant coding effort, but some guidance to the user would avoid significant waste of time when it does occur.

Brian Marriott

emqplus commented Jan 3, 2017

@marriotb Thanks for the detailed issue report. We will improve the installation and release deb and rpm packages later.

@emqplus emqplus changed the title from Emqttd fails to start if run under a different linux user than that which first ran it to EMQ fails to start if run under a different linux user than that which first ran it Jan 11, 2017
@turtleDeng turtleDeng was assigned by emqplus Jan 11, 2017
@emqplus emqplus added BUG Task labels Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment