Faulty Homegear installation over openhabian-config?

  • Platform information:
    • Hardware: Raspberry Pi 3
    • OS: openHABian (newly setup yesterday)
    • openHAB version: 0.7xx (stable) + tested on 0.8xx (nightly)
  • Issue of the topic:
    So what I am experiancing right now is generally the fact that installing Homegear over the openhabian-config is not working.

What I did was: installing fresh openHABian, use Ethernet, Update everything over openhabian-config (from now on called “ohc”), disabled serial and bluetooth over ohc, rebooted and installed homegear over ohc and configured my configfiles.
Installation runs flawless. But neither the service is starting, nor the “homegear -r” command runs. It gives this output:

07/24/20 14:23:34.164 Could not connect to socket. Error: Permission denied
07/24/20 14:23:34.165 Could not connect to socket. Error: Permission denied
07/24/20 14:23:36.164 Could not connect to socket. Error: No such file or directory
07/24/20 14:23:36.164 Could not connect to socket. Error: No such file or directory
07/24/20 14:23:36.165 Could not connect to socket. Error: Permission denied
07/24/20 14:23:36.166 Could not connect to socket. Error: Permission denied    

I think it has something to do with access and user permissions. But I am not a good linux admin (YET! :slight_smile: )

Here are some logs and informations that might help understand the problem:
homegear.err -->

07/24/20 13:26:30.940 Warning: No database found. Trying to restore backup.
07/24/20 13:26:31.369 Warning: Database could not be restored. Creating new database.
07/24/20 13:26:37.870 Could not set owner on /var/lib/homegear/defaultPassword.txt
07/24/20 13:26:39.638 Warning: configParameters with id "config" does not exist.
07/24/20 13:26:39.919 RPC Server (Port 2001): Warning: SSL is not enabled for this RPC server. It is strongly recommended to disable all unencry$
07/24/20 13:26:39.920 RPC Server (Port 2001): Warning: RPC server has no authorization enabled. Everybody on your local network can login into t$
07/24/20 13:26:39.994 RPC Server (Port 2002): Warning: RPC server has no authorization enabled. Everybody on your local network can login into t$
07/24/20 13:26:40.229 Error in file Node-BLUE/NodeManager.cpp line 229 in function static std::vector<std::shared_ptr<Homegear::NodeManager::Nod$
07/24/20 13:29:56.364 Script Engine Server: Critical: Couldn't delete existing socket: /var/run/homegear/homegearSE.sock. Please delete it manua$
07/24/20 13:29:56.368 Critical: Cannot start script engine server. Exiting Homegear.
07/24/20 13:37:13.561 Script Engine Server: Critical: Couldn't delete existing socket: /var/run/homegear/homegearSE.sock. Please delete it manua$
07/24/20 13:37:13.566 Critical: Cannot start script engine server. Exiting Homegear.
07/24/20 14:13:45.165 Unable to open family setting file: /etc/homegear/families/miscellaneous.conf. Permission denied
07/24/20 14:13:45.179 Unable to open family setting file: /etc/homegear/families/max.conf. Permission denied
07/24/20 14:13:45.200 Unable to open family setting file: /etc/homegear/families/homematicbidcos.conf. Permission denied
07/24/20 14:13:45.201 Error: No RF AES key specified in homematicbidcos.conf for communication with your BidCoS devices.
07/24/20 14:13:45.211 Unable to open family setting file: /etc/homegear/families/homematicwired.conf. Permission denied
07/24/20 14:13:45.428 Could not read device description files in directory: "/etc/homegear/devices/0/": Could not open directory "/etc/homegear/$
07/24/20 14:13:45.428 Error: Could not initialize device family HomeMatic BidCoS.
07/24/20 14:13:45.429 Could not read device description files in directory: "/etc/homegear/devices/1/": Could not open directory "/etc/homegear/$
07/24/20 14:13:45.429 Error: Could not initialize device family HomeMatic Wired.
07/24/20 14:13:45.430 Could not read device description files in directory: "/etc/homegear/devices/4/": Could not open directory "/etc/homegear/$
07/24/20 14:13:45.430 Error: Could not initialize device family MAX!.
07/24/20 14:13:45.431 Could not read device description files in directory: "/etc/homegear/devices/254/": Could not open directory "/etc/homegea$
07/24/20 14:13:45.431 Error: Could not initialize device family Miscellaneous.
07/24/20 14:13:45.502 RPC Server (Port 2001): Warning: SSL is not enabled for this RPC server. It is strongly recommended to disable all unencry$
07/24/20 14:13:45.502 RPC Server (Port 2001): Warning: RPC server has no authorization enabled. Everybody on your local network can login into t$
07/24/20 14:13:45.572 RPC Server (Port 2002): Warning: RPC server has no authorization enabled. Everybody on your local network can login into t$
07/24/20 14:13:45.784 Error in file Node-BLUE/NodeManager.cpp line 229 in function static std::vector<std::shared_ptr<Homegear::NodeManager::Nod$
07/24/20 14:21:25.031 Unable to open family setting file: /etc/homegear/families/miscellaneous.conf. Permission denied
07/24/20 14:21:25.106 Unable to open family setting file: /etc/homegear/families/max.conf. Permission denied
07/24/20 14:21:25.202 Unable to open family setting file: /etc/homegear/families/homematicbidcos.conf. Permission denied
07/24/20 14:21:25.226 Error: No RF AES key specified in homematicbidcos.conf for communication with your BidCoS devices.
07/24/20 14:21:25.291 Unable to open family setting file: /etc/homegear/families/homematicwired.conf. Permission denied
07/24/20 14:21:25.563 Script Engine Server: Critical: Couldn't delete existing socket: /var/run/homegear/homegearSE.sock. Please delete it manua$
07/24/20 14:21:25.563 Critical: Cannot start script engine server. Exiting Homegear.
07/24/20 14:39:47.209 Unable to open family setting file: /etc/homegear/families/miscellaneous.conf. Permission denied
07/24/20 14:39:47.222 Unable to open family setting file: /etc/homegear/families/max.conf. Permission denied
07/24/20 14:39:47.244 Unable to open family setting file: /etc/homegear/families/homematicbidcos.conf. Permission denied
07/24/20 14:39:47.244 Error: No RF AES key specified in homematicbidcos.conf for communication with your BidCoS devices.
07/24/20 14:39:47.255 Unable to open family setting file: /etc/homegear/families/homematicwired.conf. Permission denied
07/24/20 14:39:47.469 Script Engine Server: Critical: Couldn't delete existing socket: /var/run/homegear/homegearSE.sock. Please delete it manua$
07/24/20 14:39:47.469 Critical: Cannot start script engine server. Exiting Homegear.

homegear-log -->

07/24/20 14:21:25.627 Debug: Closing dynamic library module mod_homematicwired.so
07/24/20 14:21:25.628 Debug: Dynamic library mod_homematicwired.so disposed
07/24/20 14:21:25.628 Info: Disposing family module mod_homematicbidcos.so
07/24/20 14:21:25.628 Debug: Deleting factory pointer of module mod_homematicbidcos.so
07/24/20 14:21:25.628 Debug: Closing dynamic library module mod_homematicbidcos.so
07/24/20 14:21:25.628 Debug: Dynamic library mod_homematicbidcos.so disposed
07/24/20 14:39:44.998 Starting Homegear...
07/24/20 14:39:44.998 Homegear version 0.7.45-3101
07/24/20 14:39:44.998 Determining maximum thread count...
07/24/20 14:39:46.181 Maximum thread count is: 218
07/24/20 14:39:46.194 Info: Backing up database...
07/24/20 14:39:46.369 Initializing database...
07/24/20 14:39:47.200 Debug: Loading licensing modules
07/24/20 14:39:47.201 Initializing system variable controller...
07/24/20 14:39:47.203 Debug: Loading family modules
07/24/20 14:39:47.203 Info: Loading family module (type 1) mod_miscellaneous.so
07/24/20 14:39:47.209 Info: Loading settings from /etc/homegear/families/miscellaneous.conf
07/24/20 14:39:47.209 Unable to open family setting file: /etc/homegear/families/miscellaneous.conf. Permission denied
07/24/20 14:39:47.209 Info: Loading family module (type 1) mod_max.so
07/24/20 14:39:47.222 Info: Loading settings from /etc/homegear/families/max.conf
07/24/20 14:39:47.222 Unable to open family setting file: /etc/homegear/families/max.conf. Permission denied
07/24/20 14:39:47.223 Info: Loading family module (type 1) mod_homematicbidcos.so
07/24/20 14:39:47.243 Info: Loading settings from /etc/homegear/families/homematicbidcos.conf
07/24/20 14:39:47.244 Unable to open family setting file: /etc/homegear/families/homematicbidcos.conf. Permission denied
07/24/20 14:39:47.244 Error: No RF AES key specified in homematicbidcos.conf for communication with your BidCoS devices.
07/24/20 14:39:47.244 Info: Loading family module (type 1) mod_homematicwired.so
07/24/20 14:39:47.254 Info: Loading settings from /etc/homegear/families/homematicwired.conf
07/24/20 14:39:47.254 Unable to open family setting file: /etc/homegear/families/homematicwired.conf. Permission denied
07/24/20 14:39:47.255 Info: Homegear is (now) running as user with id 111 and group with id 118.
07/24/20 14:39:47.397 Starting script engine server...
07/24/20 14:39:47.469 Script Engine Server: Critical: Couldn't delete existing socket: /var/run/homegear/homegearSE.sock. Please delete it manua$
07/24/20 14:39:47.469 Critical: Cannot start script engine server. Exiting Homegear.
07/24/20 14:39:47.471 Closing database...
07/24/20 14:39:47.472 Debug: Can't execute "COMMIT": cannot commit - no transaction is active
07/24/20 14:39:47.526 Info: Disposing family module mod_miscellaneous.so
07/24/20 14:39:47.526 Debug: Deleting factory pointer of module mod_miscellaneous.so
07/24/20 14:39:47.526 Debug: Closing dynamic library module mod_miscellaneous.so
07/24/20 14:39:47.527 Debug: Dynamic library mod_miscellaneous.so disposed
07/24/20 14:39:47.527 Info: Disposing family module mod_max.so
07/24/20 14:39:47.527 Debug: Deleting factory pointer of module mod_max.so
07/24/20 14:39:47.527 Debug: Closing dynamic library module mod_max.so
07/24/20 14:39:47.527 Debug: Dynamic library mod_max.so disposed
07/24/20 14:39:47.527 Info: Disposing family module mod_homematicwired.so
07/24/20 14:39:47.527 Debug: Deleting factory pointer of module mod_homematicwired.so
07/24/20 14:39:47.527 Debug: Closing dynamic library module mod_homematicwired.so
07/24/20 14:39:47.527 Debug: Dynamic library mod_homematicwired.so disposed
07/24/20 14:39:47.527 Info: Disposing family module mod_homematicbidcos.so
07/24/20 14:39:47.528 Debug: Deleting factory pointer of module mod_homematicbidcos.so
07/24/20 14:39:47.528 Debug: Closing dynamic library module mod_homematicbidcos.so
07/24/20 14:39:47.528 Debug: Dynamic library mod_homematicbidcos.so disposed

Some other commands for info:

sudo ls -la /var/run/homegear/
total 4
drwxrwx---  2 root root  60 Jul 24 23:44 .
drwxr-xr-x 29 root root 900 Jul 24 23:50 ..
-rw-r--r--  1 root root   3 Jul 24 23:44 homegear-management.pid

ls -la /dev/ttyS0
crw-rw---- 1 root dialout 4, 64 Jul 24 23:44 /dev/ttyS0

There is a way to get “homegear -r” working by setting some chmod and chown commands. But still it finds no families and after a reboot everything made with chmod and chown is gone again.

Do you guys have any idea?

1 Like

Try RuntimeDirectoryMode=755 in /lib/systemd/system/homegear.service
Check User= and Group= are set in that file, too and show it here.

1 Like

Still no luck after adding Runtimedirectorymode=755 and restarting the service.

Here is homegear.service:

[Unit]
Description=Homegear
Wants=network-online.target
After=network-online.target

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
PIDFile=/var/run/homegear/homegear.pid
TimeoutSec=300
LimitRTPRIO=100
ExecStartPre=/etc/homegear/homegear-start.sh
ExecStart=/usr/bin/homegear -u homegear -g homegear -p /var/run/homegear/homegear.pid
ExecStopPost=/etc/homegear/homegear-stop.sh
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
TasksMax=infinity
LimitRTPRIO=infinity
LimitRTTIME=infinity
LimitCORE=infinity
LimitSTACK=4194304
User=homegear
Group=homegear
Runtimedirectorymode=775

Here is the homegear.log

07/25/20 11:16:31.980 Starting Homegear...
07/25/20 11:16:31.980 Homegear version 0.8.0-3046
07/25/20 11:16:31.980 Determining maximum thread count...
07/25/20 11:16:33.167 Maximum thread count is: 216
07/25/20 11:16:33.180 Info: Backing up database...
07/25/20 11:16:33.378 Initializing database...
07/25/20 11:16:34.943 Debug: Loading licensing modules
07/25/20 11:16:34.944 Info: Loading licensing module mod_licensing.so
07/25/20 11:16:34.946 Initializing system variable controller...
07/25/20 11:16:34.948 Debug: Loading family modules
07/25/20 11:16:34.948 Info: Loading family module (type 1) mod_miscellaneous.so
07/25/20 11:16:34.954 Info: Loading settings from /etc/homegear/families/miscellaneous.conf
07/25/20 11:16:34.955 Info: Loading family module (type 1) mod_max.so
07/25/20 11:16:34.968 Info: Loading settings from /etc/homegear/families/max.conf
07/25/20 11:16:34.969 Info: Loading family module (type 1) mod_homematicbidcos.so
07/25/20 11:16:34.991 Info: Loading settings from /etc/homegear/families/homematicbidcos.conf
07/25/20 11:16:34.993 Info: Loading family module (type 1) mod_homematicwired.so
07/25/20 11:16:35.003 Info: Loading settings from /etc/homegear/families/homematicwired.conf
07/25/20 11:16:35.005 Info: Homegear is (now) running as user with id 111 and group with id 118.
07/25/20 11:16:35.166 Starting script engine server...
07/25/20 11:16:35.246 Script Engine Server: Critical: Couldn't delete existing socket: /var/run/homegear/homegearSE.sock. Please delete it manually. The script engine won't work. Error: Permission denied
07/25/20 11:16:35.247 Critical: Cannot start script engine server. Exiting Homegear.
07/25/20 11:16:35.249 Closing database...
07/25/20 11:16:35.249 Debug: Can't execute "COMMIT": cannot commit - no transaction is active
07/25/20 11:16:35.295 Info: Disposing family module mod_miscellaneous.so
07/25/20 11:16:35.296 Debug: Deleting factory pointer of module mod_miscellaneous.so
07/25/20 11:16:35.296 Debug: Closing dynamic library module mod_miscellaneous.so
07/25/20 11:16:35.296 Debug: Dynamic library mod_miscellaneous.so disposed
07/25/20 11:16:35.296 Info: Disposing family module mod_max.so
07/25/20 11:16:35.296 Debug: Deleting factory pointer of module mod_max.so
07/25/20 11:16:35.296 Debug: Closing dynamic library module mod_max.so
07/25/20 11:16:35.296 Debug: Dynamic library mod_max.so disposed
07/25/20 11:16:35.296 Info: Disposing family module mod_homematicwired.so
07/25/20 11:16:35.296 Debug: Deleting factory pointer of module mod_homematicwired.so
07/25/20 11:16:35.297 Debug: Closing dynamic library module mod_homematicwired.so
07/25/20 11:16:35.297 Debug: Dynamic library mod_homematicwired.so disposed
07/25/20 11:16:35.297 Info: Disposing family module mod_homematicbidcos.so
07/25/20 11:16:35.297 Debug: Deleting factory pointer of module mod_homematicbidcos.so
07/25/20 11:16:35.297 Debug: Closing dynamic library module mod_homematicbidcos.so
07/25/20 11:16:35.297 Debug: Dynamic library mod_homematicbidcos.so disposed
07/25/20 11:16:35.297 Info: Disposing licensing module mod_licensing.so
07/25/20 11:16:35.297 Debug: Deleting factory pointer of module mod_licensing.so
07/25/20 11:16:35.298 Debug: Closing dynamic library module mod_licensing.so
07/25/20 11:16:35.298 Debug: Dynamic library mod_licensing.so disposed

did you try to manually delete the file /var/run/homegear/homegaerSE.sock and then restart the service ?

1 Like

Of course :slight_smile: But with no luck…

sudo rm /var/run/homegear/homegaerSE.sock
[sudo] password for openhabian:
rm: cannot remove '/var/run/homegear/homegaerSE.sock': No such file or directory

I guess homegear is trying to delete/access/create this file but he has no permission.

sudo ls -la /var/run/homegear/
total 4
drwxrwx---  2 root root  60 Jul 24 23:44 .
drwxr-xr-x 29 root root 920 Jul 25 11:25 ..
-rw-r--r--  1 root root   3 Jul 24 23:44 homegear-management.pid

No that’s from a different service.
Problem is directory rights they were not changed. You need to delete yours or set rights manually.

1 Like

How can I do that? :slight_smile:
And wich directorys do you mean?

Guess. chmod 755 <dirname\>

1 Like

When I do that on /var/run/homegear/ the service starts but the error log looks like this:

07/26/20 09:22:16.275 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:16.275 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:17.290 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:17.290 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:17.877 Could not read device description files in directory: "/etc/homegear/devices/0/": Could not open directory "/etc/homegear/devices/0/"
07/26/20 09:22:17.878 Error: Could not initialize device family HomeMatic BidCoS.
07/26/20 09:22:17.879 Could not read device description files in directory: "/etc/homegear/devices/1/": Could not open directory "/etc/homegear/devices/1/"
07/26/20 09:22:17.880 Error: Could not initialize device family HomeMatic Wired.
07/26/20 09:22:17.881 Could not read device description files in directory: "/etc/homegear/devices/4/": Could not open directory "/etc/homegear/devices/4/"
07/26/20 09:22:17.881 Error: Could not initialize device family MAX!.
07/26/20 09:22:17.882 Could not read device description files in directory: "/etc/homegear/devices/254/": Could not open directory "/etc/homegear/devices/254/"
07/26/20 09:22:17.882 Error: Could not initialize device family Miscellaneous.
07/26/20 09:22:17.961 RPC Server (Port 2001): Warning: SSL is not enabled for this RPC server. It is strongly recommended to disable all unencrypted RPC servers when the connected clients support it.
07/26/20 09:22:17.961 RPC Server (Port 2001): Warning: RPC server has no authorization enabled. Everybody on your local network can login into this installation. It is strongly recommended to enable authorization on all RPC servers when the connected clients support it.
07/26/20 09:22:18.040 RPC Server (Port 2002): Warning: RPC server has no authorization enabled. Everybody on your local network can login into this installation. It is strongly recommended to enable authorization on all RPC servers when the connected clients support it.
07/26/20 09:22:18.291 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:18.291 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:18.345 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:18.345 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 09:22:18.357 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:18.357 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 09:22:19.292 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:19.292 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:19.355 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:19.355 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 09:22:19.618 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:19.618 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 09:22:20.292 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:20.293 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:20.355 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:20.356 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 09:22:20.619 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:20.619 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 09:22:21.293 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:21.305 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:21.356 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:21.357 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 09:22:21.620 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:21.620 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 09:22:22.306 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:22.306 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:22.357 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:22.357 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 09:22:22.621 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:22.621 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 09:22:23.306 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:23.307 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:23.358 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:23.358 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 09:22:23.621 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:23.622 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 09:22:24.307 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:24.307 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:24.359 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:24.359 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 09:22:24.622 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:24.622 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 09:22:25.308 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:25.308 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:25.359 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:25.359 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 09:22:25.623 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:25.623 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 09:22:26.309 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 09:22:26.316 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 09:22:26.360 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 09:22:26.360 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".

And after a reboot, the chmod settings are gone again and the service does not start anymore :confused:

Add

RuntimeDirectory=homegear

to your homegear.service in section [Service]

1 Like

Nothing changed after chmod 755 /var/run/homegear/ + adding the line into the homegear.service + restarting the service:

07/26/20 11:50:12.987 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:12.987 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:13.997 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:13.997 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:14.601 Could not read device description files in directory: "/etc/homegear/devices/0/": Could not open directory "/etc/homegear/devices/0/"
07/26/20 11:50:14.602 Error: Could not initialize device family HomeMatic BidCoS.
07/26/20 11:50:14.603 Could not read device description files in directory: "/etc/homegear/devices/1/": Could not open directory "/etc/homegear/devices/1/"
07/26/20 11:50:14.603 Error: Could not initialize device family HomeMatic Wired.
07/26/20 11:50:14.604 Could not read device description files in directory: "/etc/homegear/devices/4/": Could not open directory "/etc/homegear/devices/4/"
07/26/20 11:50:14.604 Error: Could not initialize device family MAX!.
07/26/20 11:50:14.605 Could not read device description files in directory: "/etc/homegear/devices/254/": Could not open directory "/etc/homegear/devices/254/"
07/26/20 11:50:14.605 Error: Could not initialize device family Miscellaneous.
07/26/20 11:50:14.685 RPC Server (Port 2001): Warning: SSL is not enabled for this RPC server. It is strongly recommended to disable all unencrypted RPC servers when the connected clients support it.
07/26/20 11:50:14.685 RPC Server (Port 2001): Warning: RPC server has no authorization enabled. Everybody on your local network can login into this installation. It is strongly recommended to enable authorization on all RPC servers when the connected clients support it.
07/26/20 11:50:14.764 RPC Server (Port 2002): Warning: RPC server has no authorization enabled. Everybody on your local network can login into this installation. It is strongly recommended to enable authorization on all RPC servers when the connected clients support it.
07/26/20 11:50:14.998 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:14.998 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:15.119 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:15.119 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:15.130 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:15.131 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:15.999 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:15.999 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:16.128 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:16.128 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:16.394 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:16.394 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:16.999 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:17.000 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:17.129 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:17.129 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:17.395 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:17.395 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:18.000 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:18.000 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:18.129 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:18.129 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:18.395 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:18.395 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:19.001 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:19.001 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:19.130 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:19.130 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:19.396 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:19.396 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:20.002 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:20.002 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:20.131 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:20.131 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:20.397 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:20.397 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:21.003 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:21.003 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:21.131 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:21.131 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:21.398 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:21.398 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:22.004 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:22.004 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:22.132 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:22.132 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:22.398 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:22.399 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:23.004 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:23.009 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:23.133 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:23.133 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:23.399 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:23.399 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:24.010 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:24.010 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:24.133 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:24.133 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:24.400 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:24.400 Node-BLUE Server: Error: chmod failed on unix socket "/var/run/homegear/homegearFE.sock".
07/26/20 11:50:25.010 Script Engine Server: Critical: Script engine server could not start listening. Error: Permission denied
07/26/20 11:50:25.011 Script Engine Server: Error: chmod failed on unix socket "/var/run/homegear/homegearSE.sock".
07/26/20 11:50:25.134 IPC Server: Critical: Flows server could not start listening. Error: Permission denied
07/26/20 11:50:25.134 IPC Server: Error: chmod failed on unix socket "/var/run/homegear/homegearIPC.sock".
07/26/20 11:50:25.401 Node-BLUE Server: Critical: Flows server could not start listening. Error: Permission denied

how do you start homegear ?
where does this log originate from ?
how does /lib/systemd/system/homegear.service look like?

/etc/homegear and below isn’t readable for the homegear user. It works when you properly start from openHABian but it seems you have copied or restored /etc/homegear from whatever source where it was already wrong. Change using chmod

And

RuntimeDirectoryMode=755

how do you start homegear ?

I dont - it’s starting through the service i think?

The log comes from:

var/log/homegear/homegear.err
var/log/homegear/homegear.log

Here is my homegear.service:

GNU nano 3.2                     /lib/systemd/system/homegear.service

[Unit]
Description=Homegear
Wants=network-online.target
After=network-online.target

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
PIDFile=/var/run/homegear/homegear.pid
TimeoutSec=300
LimitRTPRIO=100
ExecStartPre=/etc/homegear/homegear-start.sh
ExecStart=/usr/bin/homegear -u homegear -g homegear -p /var/run/homegear/homegear.pid
ExecStopPost=/etc/homegear/homegear-stop.sh
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
TasksMax=infinity
LimitRTPRIO=infinity
LimitRTTIME=infinity
LimitCORE=infinity
LimitSTACK=4194304
User=homegear
Group=homegear
RuntimeDirectory=homegear
Runtimedirectorymode=775

And as I told you: when I change the directories ownership with "chmod -R homegear:homegear folders " this setting is gone when I reboot :confused:

Do you need any more logs or file contents to read for info?

That does not exist if you properly installed via openHABian.

As you have modified the default yourself you need to fix it yourself, too.
You must not simply copy-in something that worked elsewhere. That’s not how Linux services work.

And as I said you need to fix /etc/homegear to be readable for the homegear user.

Last line is bad (you need upper case D and M)

That does not exist if you properly installed via openHABian.
As you have modified the default yourself you need to fix it yourself, too.
You must not simply copy-in something that worked elsewhere. That’s not how Linux services work.

Sorry I dont understand. I surely just installed through openhabian-config. Or what do you mean?

Can I just start the installation through openhabian-config again? To “clean” reinstall homegear if something went wrong?

No you must have done something else, restored a backup, manually started homegear as root, whatever. I don’t know.

No.
You could use apt-get purge homegear and double-check all places that it’s gone.
(I don’t know what these are, /etc/homegear and /var/log/homegear and /lib/system/system/homegear* but possibly more).
Use openHABian to install again but first switch to master branch if you have not done so yet.

And if you then restore anything from a backup or the like, you will have the same problems again as that overwrites correctly setup files/dirs so don’t do that.

A clean installation on an openhabian image does not work either :confused:

Also it seems like I am not the only one with that problem. And it does not seem to be “my fault” I guess :confused:
Look at that thread (german)–> https://forum.homegear.eu/t/openhabian-homegear-fehler-could-not-connect-to-socket-permission-denied/3609/10

Nach vielen Installationsversuchen und Stunden des Probierens komme ich zum Schluss, dass mit einer Veränderung des OpenHABian Linux GPIO Zugriffe anders funktionieren. Leider habe ich kein Image mehr, das noch funktioniert, weil gleich beim Installieren ein Update drüber läuft. Sehr ärgerlich.

Ich habe ein Buster Image openhabian-pi-raspbian-201908050414-gitca0976f-crc6a66b5a1.img.xz und ein Strech Image openhabianpi-raspbian-201804031720-gitdba76f6-crc9e93c3eb.img.xz probiert. Jedes Mal lande ich nach der Installation bei openHAB 2.5.7-1 (Release Build).

sudo openhabian-config
Install Homegear in Optional Components
WICHTIG: Apply Improvements -> Fix Permissions (otherwise Could not connect to socket. Error: No such file or directory for homegear -r)

Anpassungen an vier Dateien /etc/homegear/families/homematicbidcos.conf, /boot/config.txt, /boot/cmdline.txt und /etc/udev/rules.d/99-com.rules wie hier
https://doc.homegear.eu/homegear-homematicbidcos/configuration.html beschrieben.

Reboot

Module HomeMatic BidCoS: HM-MOD-RPI-PCB “My-HM-MOD-RPI-PCB”: Error in file PhysicalInterfaces/Hm-Mod-Rpi-Pcb.cpp line 969 in function void idCoS::Hm_Mod_Rpi_Pcb::doInit(): Failed to open value file for GPIO with index 1 and device “hm-mod-rpi-pcb”: Unable to retrieve path.
Im Source Code https://github.com/Homegear/Homegear-HomeMaticBidCoS/blob/master/src/PhysicalInterfaces/Hm-Mod-Rpi-Pcb.cpp
openGPIO(1, false);
setGPIO(1, false);
std::this_thread::sleep_for(std::chrono::milliseconds(100));
setGPIO(1, true);
closeGPIO(1);

Da scheint der Zugriff auf GPIO im Raspi nicht freigegeben zu sein. Beschreibung liegt hier /boot/overlays/README.

Vielleicht in /boot/config.txt? Hat jemand eine Idee, was korrigiert werden muss?

This is an international forum so please use English.
Open another thread rather than to follow up on someone’s that is about a different issue.
Also follow the other rules in How to ask a good question / Help Us Help You - Tutorials & Examples - openHAB Community

On your issue, if I understand correctly, you want to control your Pi’s GPIOs through homegear directly but running openHABian ?
While that might have worked in the past or not, the root cause of your problem is that you use a conceptually wrong approach. You’re apparently coming from the HM/homegear world, but openHABian is built to support openHAB, not homegear as the controller.
If you wanted to use the RPI as an acutator, i.e. control GPIO directly, you would need to use a GPIO openHAB binding.
GPIO access from OH(ian) has been unchanged in a long time so I believe it’s still working fine.
Adding homegear user to a UNIX group that has write access to GPIO devices will probably do the trick, but as I said your concept is broken and not supported in openHAB(ian).

Then in the first place you should be reading and responding to my post. But you ignored what I said there.
You must not try to setup homegear to control GPIOs. Or, if you want to do that, at least don’t use openHABian and ask for help in an openHABian forum where experts tell you this is a wrong, unsupported setup.

In what component, and what do you mean by “GPIO setup procedure”?
Stretch is ancient so lots of things changed since that was current.

What changed most recently is that homegear now runs as an ordinary user in openHABian thus no longer has access to device files.

Second, that’s what your “workaround” changes, but that’s a very bad move as it’ll exclude other users such as the openhab user from accessing GPIOs.
Please retract your “solution” as that’ll break proper usage in openHAB.