Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial connections not working on some Linux distros due to /var/lock permissions #2474

Closed
pdcrom opened this issue Sep 4, 2021 · 5 comments
Labels
external bug A problem or unintended behavior of an external library

Comments

@pdcrom
Copy link

pdcrom commented Sep 4, 2021

Opened this initially on the zwave binding github, but it appears this is part of the openhab-core?

When installing openhab 3.1.0 on linux based on Red Hat 8, I used Rocky Linux 8.4 and installed:

Installed Packages
openhab.noarch 3.1.0-1 @openhab-stable

the binding wants to write to /var/lock/ for the serial stick which is owned by root:root on these linux versions, so that fails and an error is shown in the journal:

Sep 03 17:13:06 openhab-dev karaf[769]: check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file.

The paved road is for applications to write to a sub folder under /var/lock/ and include a drop-in /etc/tmpfiles.d to create that folder.

A workaround is discussed here: https://community.openhab.org/t/solved-oh3-zwave-binding-z-wave-serial-controller-aeotec-z-stick-gen5-remains-offline/108182/36

By copying the /usr/lib/tmpfiles.d/legacy.conf to /etc//tmpfiles.d/legacy.conf, and modifying the lines to :

d /run/lock 0755 root root -

to

d /run/lock 0775 root openhab -

and the binding is able to create the lock file and the zwave controller gets online:

[root@openhab-dev ~]# ll /var/lock/
total 4
-rw-r--r-- 1 root root 0 Sep 1 18:52 kdump
-rw-r--r-- 1 openhab openhab 11 Sep 3 17:01 LCK..ttyACM0
drwx------ 2 root root 40 Sep 1 18:52 lvm
drwxr-xr-x 2 root root 40 Sep 1 18:52 subsys

Regards,

Paul.

@wborn
Copy link
Member

wborn commented Sep 13, 2021

It's a nrjavaserial issue, so there is not really much to fix in openHAB except for upgrading the library to a version that fixes your issue.

See also: NeuronRobotics/nrjavaserial#60

@wborn wborn added the external bug A problem or unintended behavior of an external library label Sep 13, 2021
@pdcrom
Copy link
Author

pdcrom commented Sep 13, 2021

Clear, I see it is open since 2016 :-)
Happy the work around also does the job.

@wborn wborn changed the title serial zwave stick not working out-of-the-box on some linux versions Serial zwave stick not working out-of-the-box on some linux versions Oct 13, 2021
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/problem-with-setting-up-zooz-usb-z-wave-plus-s2-stick-zst10/134603/64

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/no-serial-connection-with-smartmeter-binding-after-update-to-oh3/135469/7

@wborn wborn changed the title Serial zwave stick not working out-of-the-box on some linux versions Serial connections not working on some Linux distros due to /var/lock permissions Apr 27, 2022
@J-N-K
Copy link
Member

J-N-K commented May 7, 2022

Since this is not an openHAB bug, and proper documentation has been added, I'll close here.

@J-N-K J-N-K closed this as completed May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external bug A problem or unintended behavior of an external library
Projects
None yet
Development

No branches or pull requests

4 participants