tteck / Proxmox

Proxmox VE Helper-Scripts
https://Helper-Scripts.com
MIT License
14.49k stars 2.39k forks source link

Zwave-js-ui permission issues #566

Closed zelig2 closed 2 years ago

zelig2 commented 2 years ago

I set up a new LXC for zwave-js-ui using your script. It seemed to go fine on the install but it appeared to not load up in systemctl. Here are the errors I see:

Sep 27 15:40:05 zwave-js-ui zwave-js-ui[319]: 2022-09-27 15:40:05.764 INFO Z-WAVE: Connecting to /dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Cont>
Sep 27 15:40:05 zwave-js-ui zwave-js-ui[319]: Logging to file:
Sep 27 15:40:05 zwave-js-ui zwave-js-ui[319]:         /opt/zwave-js-ui/store/logs/zwavejs_2022-09-27.log
Sep 27 15:40:05 zwave-js-ui zwave-js-ui[319]: Error: EACCES: permission denied, open '/opt/zwave-js-ui/store/logs/zwavejs_2022-09-27.log'
Sep 27 15:40:05 zwave-js-ui systemd[1]: zwave-js-ui.service: Main process exited, code=exited, status=1/FAILURE

So then I went to the directory and found this:

root@zwave-js-ui:/opt/zwave-js-ui# ls -al
total 261604
drwxr-xr-x 3 root   root         4096 Sep 27 15:49 .
drwxr-xr-x 3 root   root         4096 Sep 27 15:30 ..
drwxr-xr-x 6 nobody nogroup      4096 Sep 27 15:36 store
-rwxr-xr-x 1 root   root    206026512 Sep 26 12:55 zwave-js-ui

Using chown -R root store kicks back weird errors like:

chown: changing ownership of 'store': Operation not permitted

Maybe this is from running the transfer script on a container I set up before I found your scripts. Most of my other containers are from your scripts but my zwave was an original one that I had been maintaining/updating. I also created the zwave-js-ui container without elevated privileges. Thanks.

tteck commented 2 years ago

On a new install:

root@zwave-js-ui:/opt/zwave-js-ui# ls -al
total 201216
drwxr-xr-x 3 root root      4096 Sep 27 19:16 .
drwxr-xr-x 3 root root      4096 Sep 27 19:16 ..
drwxr-xr-x 5 root root      4096 Sep 27 19:16 store
-rwxr-xr-x 1 root root 206026512 Sep 26 12:55 zwave-js-ui

Can you use the numerical UID and GID values with the chown command?

tteck commented 2 years ago

Again, on a new install:

root@zwave-js-ui:~# systemctl status zwave-js-ui
* zwave-js-ui.service - zwave-js-ui
     Loaded: loaded (/etc/systemd/system/zwave-js-ui.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-09-27 19:38:58 UTC; 1min 14s ago
   Main PID: 5891 (zwave-js-ui)
      Tasks: 10 (limit: 38273)
     Memory: 71.5M
        CPU: 1.685s
     CGroup: /system.slice/zwave-js-ui.service
             `-5891 /opt/zwave-js-ui/zwave-js-ui

Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]:  /_____|      /  / __,_| _/ ___|    ____/|_____/     ____/|__>
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]:                                                              >
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]: 2022-09-27 19:39:00.162 WARN STORE: settings.json not found
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]: 2022-09-27 19:39:00.164 WARN STORE: scenes.json not found
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]: 2022-09-27 19:39:00.165 WARN STORE: nodes.json not found
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]: 2022-09-27 19:39:00.171 WARN STORE: users.json not found
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]: 2022-09-27 19:39:00.176 INFO APP: Listening on port 8091 host>
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]: 2022-09-27 19:39:00.246 WARN BACKUP: Store backup is disabled
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]: 2022-09-27 19:39:00.246 WARN BACKUP: Nvm backup is disabled
Sep 27 19:39:00 zwave-js-ui zwave-js-ui[5891]: 2022-09-27 19:39:00.246 WARN Z-WAVE: Z-Wave driver not inited>
tteck commented 2 years ago

Closed after 12 hours of NO activity.