Add example systemd service files#6
Conversation
Add the example systemd service files from the OpenEmbedded recipe[0]. The files are licenced under the same licence as the upstream project. Link[0]: https://git.openembedded.org/meta-openembedded/tree/meta-filesystems/dynamic-layers/meta-python/recipes-support/gpiod-sysfs-proxy/gpiod-sysfs-proxy Fixes: brgl#3 Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
|
Should we install the files too if we ship them? And how about dropping the sysv init script? I added it to yocto because sysv was the default at the time but I consider dropping it with systemd becoming the default. |
The sysvinit script is no longer used and the systemd services is preferred to be used. Remove the sysvinit script. Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Assume the default target of /sys/class/gpio for the mountpoint so we don't have to template the systemd service at install time. Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Install the systemd service as part of the pyproject installation process. Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Did that. I didn't check if pyproject actually installs all the files though. I dropped the sysvinit script and set a default mountpoint of |
That's a question actually. If you can't test it (for instance: modify the yocto recipe to use it) then I'm fine with shipping them as an example and not installing them. |
I think the services get installed properly. I just checked this with: it shows: and I think those files woukd go into |
| ] | ||
| "lib/systemd/system/sysinit.target.wants" = [ | ||
| "share/sysinit.target.wants/run-gpio-sys.mount", | ||
| "share/sysinit.target.wants/sys-class.mount", |
There was a problem hiding this comment.
This installs these files unconditionally. In my meta-openembedded recipe I only do this if the user selected the - admittedly quite intrusive - sys-class-mount PACKAGECONFIG switch. Should we have a corresponding switch here as well?
There was a problem hiding this comment.
This installs these files unconditionally. In my meta-openembedded recipe I only do this if the user selected the - admittedly quite intrusive -
sys-class-mountPACKAGECONFIG switch. Should we have a corresponding switch here as well?
Not sure if we can have a switch here without a lot of fudging around - that's why I made the python package install the most useful default service by default.
Do we really need to support both paths? I don't know enough about this really, but I suspect it'd make sense to support one by default in distros like debian etc?
Perhaps it'd make sense to install using a default path and push users to README for information to use alternate paths? again, I am not entirely sure here, but surely for modern installs there is a sensibe default? :-)
There was a problem hiding this comment.
TBH I never really considered this could be packaged in Debian. :) Is mounting an overlay over /sys/class something Debian would accept as the default? Sounds quite risky to me.
There was a problem hiding this comment.
Seems fine to me, if you install this you kind of need it to work :-)
Alternatively in the python install we could install 2x systemd services (one for each path, or a template and 2x services extending the template) to a doc dir (e.g. not install them), then in yocto/debian we could install the script by default and have the services as as separate packages, and let users choose which package they want to install (and in yocto you can keep the same var, just install different services to the right place) ?
There was a problem hiding this comment.
Or (for yocto) possibly two mutually-exclusive packages: gpiod-sysfs-proxy-systemd-overlay and gpiod-sysfs-proxy-systemd-tmp with the former installing the /sys/class overlay units?
There was a problem hiding this comment.
exactly, and in this python installer i should put the service files into a documentation dir.
Need to figure out how to make the services extend another service so we don't duplicate code.
There was a problem hiding this comment.
Would it be too much to ask to also update the yocto recipe if you're doing it? :)
Add the example systemd service files from the OpenEmbedded recipe[0].
The files are licenced under the same licence as the upstream project.
Link[0]: https://git.openembedded.org/meta-openembedded/tree/meta-filesystems/dynamic-layers/meta-python/recipes-support/gpiod-sysfs-proxy/gpiod-sysfs-proxy
Fixes: #3