app-misc/lirc may be used also in conjunction with systemd by keeping the existing config files and scripts architecture based on baselayout / openrc, even if setting up systemd to work with or without any openrc remains. Reproducible: Always
Created attachment 366826 [details] lircd service unit lircd.service unit "provides" lirc service as an alias
Created attachment 366828 [details] irexec executed as specified user helper service unit this helper service unit for irexec does the job as the user specified in /etc/conf.d/irexec, but should only be started by the wrapper irexec.service
Created attachment 366830 [details] irexec service wrapper unit this one should actually be enabled for irexec usage
Created attachment 366832 [details, diff] modified lirc-0.9.0.ebuild
For usage with systemd, only lircd.service and irexec.service (the latter, if needed) should be activated. irexec_as_user@.service is invoked by irexec.service. The unit file lircd.service also defines the alias "lirc" because on some systems another implementation of the lirc daemon might be used (I will submit myself app-misc/eventlircd soon, which is an alternative to the lircd itself only, not to the whole lirc package).
+*lirc-0.9.0-r5 (03 Jan 2014) + + 03 Jan 2014; Pacho Ramos <pacho@gentoo.org> +files/irexec.service, + +files/lirc.service, +files/lircm.service, +lirc-0.9.0-r5.ebuild: + Add unit files (#496852 by Lucian Muresan) + For future reference about our policies and how to prepare systemd units, please take a look to: https://wiki.gentoo.org/wiki/Systemd/Ebuild_policy Thanks
Thanks for adding systemd unit files to official portage so quickly, Pacho, but I have a question, since you did not add mine, although mentioning this bug number. How is somebody supposed to let irexec be executed as a specific user in a convenient way (as convenient as it is with OpenRC in Gentoo, we're still using Gentoo here, even if the systemd author's philosophy is to unify usage of any package regardless of the distribution)? Maybe I did not yet understand enough about systemd usage, but is that possible with the unit files currently added? To my current knowledge, I think one would have to place his own unit file in /etc/systemd/system, containing a "User=someone" directive 'cause nobody should edit files in /usr/lib/systemd/system where they would get overwritten by the next package upgrade, right? But then again, if users are forced to make copies of provided unit files, just because systemd has to be shipped that way only, it's just comparable with the hypotetical situation that for OpenRC usage one would also have to customize the service scripts under /etc/init.d and not only their configuration files under /etc/conf.d. I mean, if I have to make my own copy of the unit file to have it work the way I need it, then I'm losing any progress the original might undergo across different versions, unless I explicitly check for such a thing at each update, why should I have to do that?
Well, I checked the unit files that were being provided in other distributions, and seemed that all of them were going with a much simpler approach like the one chosen when committing. The idea is to ship a unit file that will work for most setups (and that should work as I have seen in Arch, Fedora and Mageia). For doing special things, you should create your own unit file under /etc/systemd/system. The rationale is a bit explained in: http://0pointer.de/blog/projects/on-etc-sysinit.html In some cases, we need to let people set some options (for example some stuff needs to let people configure a server IP to connect), but, in this concrete case, looks like most distributions have enough with this for most people
(In reply to Lucian Muresan from comment #7) > How is somebody supposed to let irexec be executed as a specific user in a > convenient way (as convenient as it is with OpenRC in Gentoo, we're still > using Gentoo here, even if the systemd author's philosophy is to unify usage > of any package regardless of the distribution)? (written without checking, may have tiny mistakes in paths or stuff) mkdir /etc/systemd/system/irexec.service.d echo 'User=foobar' > /etc/systemd/system/irexec.service.d/12whatever.conf Next time, please don't waste our time with your essays on philosophy.
Thank you Pacho and Michal for explaining and for the pointers. As of calling my question from a user's point of view and explanations to background of the question "essays on philosophy" waisting your time, you, Michal, as it seems to me, a systemd guy, come on, just give me a break, I'm not interested in yet another systemd vs. anything else flamewar. There have been enough of those, there might still be otheres, I don't have time either for them, just trying to use it, not fight it (I'm actually on Sabayon for it's binary updates, but using it as what it still is inside, Gentoo, and Fabio already made systemd the default on new installations).