| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- /etc/init.d/emqttd
- ==================
- ::
- #!/bin/sh
- #
- # emqttd Startup script for emqttd.
- #
- # chkconfig: 2345 90 10
- # description: emqttd is mqtt broker.
- # source function library
- . /etc/rc.d/init.d/functions
- # export HOME=/root
- start() {
- echo "starting emqttd..."
- cd /opt/emqttd && ./bin/emqttd start
- }
- stop() {
- echo "stopping emqttd..."
- cd /opt/emqttd && ./bin/emqttd stop
- }
- restart() {
- stop
- start
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop}"
- RETVAL=2
- esac
- chkconfig
- ---------
- ::
- chmod +x /etc/init.d/emqttd
- chkconfig --add emqttd
- chkconfig --list
- boot test on ubuntu
- -------------------
- ::
- service emqttd start
- erlexec: HOME must be set
- -------------------
- uncomment '# export HOME=/root' if "HOME must be set" error.
- Referrence
- ---------
- .. `How to make unix service see environment variables?`_: http://unix.stackexchange.com/questions/44370/how-to-make-unix-service-see-environment-variables/44378#44378
|