openv / vcontrold

:fire: vcontrold Daemon for control and logging of Viessmann® type heating devices
https://github.com/openv/openv/wiki
GNU General Public License v3.0
101 stars 54 forks source link

Sticky Bit not set for vcontrold #20

Closed emichel11 closed 6 years ago

emichel11 commented 6 years ago

After make sudo make install the vcontrold and vclient are build and installed. The vcontrold is copied into "usr/local/sbin" if vcontrold runs as daemon it tries to create a PID lock file in /var/run/vcontrold.pid However if the sticky bit is not set the code in vcontrold.c sid = setsid(); has not effect and there might not be enough rights to create the PID file. This happens especially when one creates a service file for systemctl As a workaround set the sticky bit manually sudo chmod +s /usr/local/sbin/vcontrold

As an improvement change "make install" appropriately.

l3u commented 6 years ago

I don't fully understand why you want to set the sticky bit here … normally you only use it for folders nowadays?

I have vcontrold installed on my Raspberry Pi running Gentoo. No sticky bit is set, and vcontrold is started using OpenRC and a minimal init script. Runs just fine! And not a single other daemon has the sticky bit set here.

Probably, this is distribution specific for your case?

emichel11 commented 6 years ago

Hello Tobias, sorry for the late reply. generally you are right. vcontrold works as expected - if you start it as "root". If you run it as ordinary user vcontrold has usually no access to /var/log/ and therefore cannot touch the file vcontrold.pid - it will fail to start. Additionally it is not the sticky-bit - my fault. It is the s-Bit for setuid for the root owned vcontrold. My request should be seen as an improvement with low priority.

speters commented 6 years ago

Fixed by https://github.com/openv/vcontrold/pull/21