Replies: 1 comment
-
When doing "sudo" you start npm as root, whereas the service file runs as the openhabian user. That may be the reason. chown -R openhabian /opt/zigbee2mqtt/ |
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
-
Hello!
When starting sudo npm start everithing goes fine, just cant start the scripit.
Siting all day long no ideas anymore.
This is what is showing up after start as service.
Jan 01 20:41:26 openHABianPi npm[5717]: at /opt/zigbee2mqtt/node_modules/rimraf/rimraf.js:336:39
Jan 01 20:41:26 openHABianPi npm[5717]: at Array.forEach ()
Jan 01 20:41:26 openHABianPi npm[5717]: at rmkidsSync (/opt/zigbee2mqtt/node_modules/rimraf/rimraf.js:336:26)
Jan 01 20:41:26 openHABianPi npm[5717]: at rmdirSync (/opt/zigbee2mqtt/node_modules/rimraf/rimraf.js:329:7)
Jan 01 20:41:26 openHABianPi npm[5717]: at Function.rimrafSync [as sync] (/opt/zigbee2mqtt/node_modules/rimraf/rimraf.js:301:9)
Jan 01 20:41:26 openHABianPi npm[5717]: at /opt/zigbee2mqtt/lib/util/logger.js:113:20
Jan 01 20:41:26 openHABianPi npm[5717]: at Array.forEach ()
Jan 01 20:41:26 openHABianPi npm[5717]: at DerivedLogger.cleanup (/opt/zigbee2mqtt/lib/util/logger.js:111:21)
Jan 01 20:41:26 openHABianPi npm[5717]: (node:5732) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)Jan 01 20:41:26 openHABianPi npm[5717]: (node:5732) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This is my service config file...
[Unit]
Description=zigbee2mqtt
After=network.target
[Service]
ExecStart=/usr/bin/npm start
WorkingDirectory=/opt/zigbee2mqtt
StandardOutput=inherit
StandardError=inherit
Restart=always
User=openhabian
[Install]
WantedBy=multi-user.target
Beta Was this translation helpful? Give feedback.
All reactions