GithubHelp home page GithubHelp logo

Comments (3)

Zagrophyte avatar Zagrophyte commented on May 26, 2024 1

Is your built release still in _rel? It looks like you're mixing init.d and systemd scripts, as well as referring to paths where your binaries don't exist.

I had success with systemd, here's what I did:

  1. Build emq-relx (looks like you've done this already)
  2. Copy the emqttd folder that's in _rel to /home/pi/emqttd
  3. I made a systemd service file called emqttd.service that looks like the following (substitute root with whatever user/group you have created for this purpose):
WorkingDirectory=/home/pi/emqttd
ExecStart=/home/pi/emqttd/bin/emqttd start
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=emqttd
User=root
Group=root
Type=forking
[Install]
WantedBy=multi-user.target
  1. Copy to systemd system folder sudo cp emqttd.service /etc/systemd/system/emqttd.service
  2. Enable the service: sudo systemctl enable emqttd
  3. Reload the daemon: sudo systemctl daemon-reload (do this anytime you edit the service file!)
  4. Try to start: sudo systemctl start emqttd
  5. If any errors occurred, check for errors: journalctl -xe

I think I got all the steps I took above, let me know if I missed anything.

from emqx-rel.

htaoufikallah avatar htaoufikallah commented on May 26, 2024 1

Thank you @Zagrophyte and @turtleDeng for your help.
I followed @Zagrophyte guide and it worked for me, here is my final service file content:

[Unit]
Description=EMQTTD mqtt broker
After=network.target

[Service]
WorkingDirectory=/home/pi/emqttd
ExecStart=/home/pi/emqttd/bin/emqttd start
ExecStop=/home/pi/emqttd/bin/emqttd stop
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=emqttd
User=root
Group=root
Type=forking
[Install]
WantedBy=multi-user.target

from emqx-rel.

turtleDeng avatar turtleDeng commented on May 26, 2024

@hictao
run 'journalctl -xe' to get error logs

from emqx-rel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.