Daemonize and get the PID #80
Replies: 4 comments 2 replies
-
My first proposal would be to add the command line parameter |
Beta Was this translation helpful? Give feedback.
-
It's been two days now. I have been trying to write a script — which will be run by cron — to read the GPU temperature and control the case fan of my Raspberry Pi using libgpiod. The unspecified behavior when you're not "holding" a line creates complications, because you have to come up with some lock-file logic to try to prevent multiple instances of your script running at the same time. You'll always have to be "holding" a value. I just want to set a value and have it "stick" there. I don't want to manage PIDs and have long-running tasks. I don't want to write a daemon for something this simple. It only took me a few minutes to write such script using gpioctl on OpenBSD. Update: issue #47 will address this. |
Beta Was this translation helpful? Give feedback.
-
I don't have anything against adding this functionality. I'll add it to the TODO as I have too much on my professional plate to take care of this right now. But feel free to add this functionality to gpioset if you can and send patches for review to linux-gpio. |
Beta Was this translation helpful? Give feedback.
-
I've written a shell script to control the Raspberry Pi case fan using libgpiod. This uses a PID file to manage the running process. https://gitlab.com/crimson.king/rpi-case-fan-libgpiod Can't wait for the DBus interface to be released :) |
Beta Was this translation helpful? Give feedback.
-
When you use
--daemonize
, the CLI tools don't tell you the PID of the created process. Sure, I could use something likepidof
, but what if multiple instances ofgpioset
are running at the time? This is not doable. I need another approach. What do you think?I'm using the CLI tools from a shell script.
libgpiod v2.1.2
Beta Was this translation helpful? Give feedback.
All reactions