Replies: 1 comment
-
You would want to create a systemd unit file, though honestly... switching to Docker is likely to be overall simpler. Here's an example systemd unit file that runs Zigbee2MQTT as the user
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I recently installed Zigbee2Mqtt on my raspberry pi 3.
Everything worked fine but now I'm having a problem.
I want to use Zigbee2Mqtt as a daemon so I don't need to have ssh active.
I followed the tutorial on the "Linux installation" tap but now I can't reach the web interface anymore and on the logs, I can see that the service is not starting.
It's only working if I'm starting the service with these commands "cd /opt/zigbee2mqtt, npm start".
But at the moment I'm closing the ssh connection it stops.
Maybe someone in this forum has an idea?
Thank you very much in advance!
Sep 03 10:23:41 Grafana systemd[1]: zigbee2mqtt.service: Consumed 9.508s CPU time. Sep 03 10:23:41 Grafana npm[907]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12) Sep 03 10:23:41 Grafana npm[907]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12) Sep 03 10:23:41 Grafana npm[907]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12) Sep 03 10:23:41 Grafana npm[907]: at Object.mkdirSync (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:82:10) Sep 03 10:23:41 Grafana npm[907]: at Object.init (/opt/zigbee2mqtt/lib/util/logger.ts:43:12) Sep 03 10:23:41 Grafana npm[907]: at new Controller (/opt/zigbee2mqtt/lib/controller.ts:53:16) Sep 03 10:23:41 Grafana npm[907]: at start (/opt/zigbee2mqtt/index.js:108:18) Sep 03 10:23:41 Grafana systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=1/FAILURE Sep 03 10:23:41 Grafana systemd[1]: zigbee2mqtt.service: Failed with result 'exit-code'. Sep 03 10:23:41 Grafana systemd[1]: zigbee2mqtt.service: Consumed 9.508s CPU time.Sep 03 10:23:51 Grafana systemd[1]: zigbee2mqtt.service: Scheduled restart job, restart counter is at 3. Sep 03 10:23:51 Grafana systemd[1]: Stopped zigbee2mqtt. Sep 03 10:23:51 Grafana systemd[1]: zigbee2mqtt.service: Consumed 9.508s CPU time. Sep 03 10:23:51 Grafana systemd[1]: Started zigbee2mqtt. Sep 03 10:23:53 Grafana npm[920]: > [email protected] start Sep 03 10:23:53 Grafana npm[920]: > node index.js Sep 03 10:23:59 Grafana npm[932]: Error: EACCES: permission denied, mkdir '/opt/zigbee2mqtt/data/log/2022-09-03.10-23-59' Sep 03 10:23:59 Grafana npm[932]: at Object.mkdirSync (node:fs:1386:3) Sep 03 10:23:59 Grafana npm[932]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:199:16) Sep 03 10:23:59 Grafana npm[932]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12) Sep 03 10:23:59 Grafana npm[932]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12) Sep 03 10:23:59 Grafana npm[932]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12) Sep 03 10:23:59 Grafana npm[932]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12) Sep 03 10:23:59 Grafana npm[932]: at Object.mkdirSync (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:82:10) Sep 03 10:23:59 Grafana npm[932]: at Object.init (/opt/zigbee2mqtt/lib/util/logger.ts:43:12) Sep 03 10:23:59 Grafana npm[932]: at new Controller (/opt/zigbee2mqtt/lib/controller.ts:53:16) Sep 03 10:23:59 Grafana npm[932]: at start (/opt/zigbee2mqtt/index.js:108:18) Sep 03 10:23:59 Grafana systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=1/FAILURE Sep 03 10:23:59 Grafana systemd[1]: zigbee2mqtt.service: Failed with result 'exit-code'. Sep 03 10:23:59 Grafana systemd[1]: zigbee2mqtt.service: Consumed 9.397s CPU time. Sep 03 10:24:09 Grafana systemd[1]: zigbee2mqtt.service: Scheduled restart job, restart counter is at 4. Sep 03 10:24:09 Grafana systemd[1]: Stopped zigbee2mqtt. Sep 03 10:24:09 Grafana systemd[1]: zigbee2mqtt.service: Consumed 9.397s CPU time.
Beta Was this translation helpful? Give feedback.
All reactions