| 1 | #!/sbin/openrc-run |
| 2 | |
| 3 | name="nmqtt" |
| 4 | description="MQTT Broker" |
| 5 | command="/usr/bin/nmqtt" |
| 6 | command_args="${NMQTT_OPTS:--c /etc/nmqtt/nmqtt.conf}" |
| 7 | command_user="${NMQTT_USER:-nmqtt:nmqtt}" |
| 8 | command_background="yes" |
| 9 | pidfile="/run/${RC_SVCNAME}.pid" |
| 10 | output_log="/var/log/nmqtt/nmqtt.log" |
| 11 | error_log="/var/log/nmqtt/nmqtt.err" |
| 12 | |
| 13 | depend() { |
| 14 | need net |
| 15 | after firewall |
| 16 | } |
| 17 | |
| 18 | start_pre() { |
| 19 | checkpath --directory --owner $command_user --mode 0755 \ |
| 20 | /var/log/nmqtt \ |
| 21 | /var/lib/nmqtt |
| 22 | } |