Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 496852 - app-misc/lirc-0.9.0 add systemd units
Summary: app-misc/lirc-0.9.0 add systemd units
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Television related Applications in Gentoo's Portage
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit 353492
  Show dependency tree
 
Reported: 2014-01-03 10:33 UTC by Lucian Muresan
Modified: 2014-01-03 23:03 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lircd service unit (lircd.service,543 bytes, text/plain)
2014-01-03 10:41 UTC, Lucian Muresan
Details
irexec executed as specified user helper service unit (irexec_as_user_AT.service,307 bytes, text/plain)
2014-01-03 10:43 UTC, Lucian Muresan
Details
irexec service wrapper unit (irexec.service,481 bytes, text/plain)
2014-01-03 10:44 UTC, Lucian Muresan
Details
modified lirc-0.9.0.ebuild (lirc-0.9.0.ebuild.diff,2.01 KB, patch)
2014-01-03 10:45 UTC, Lucian Muresan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lucian Muresan 2014-01-03 10:33:18 UTC
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
Comment 1 Lucian Muresan 2014-01-03 10:41:30 UTC
Created attachment 366826 [details]
lircd service unit

lircd.service unit "provides" lirc service as an alias
Comment 2 Lucian Muresan 2014-01-03 10:43:31 UTC
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
Comment 3 Lucian Muresan 2014-01-03 10:44:27 UTC
Created attachment 366830 [details]
irexec service wrapper unit

this one should actually be enabled for irexec usage
Comment 4 Lucian Muresan 2014-01-03 10:45:14 UTC
Created attachment 366832 [details, diff]
modified lirc-0.9.0.ebuild
Comment 5 Lucian Muresan 2014-01-03 10:49:05 UTC
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).
Comment 6 Pacho Ramos gentoo-dev 2014-01-03 11:14:15 UTC
+*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
Comment 7 Lucian Muresan 2014-01-03 20:04:15 UTC
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?
Comment 8 Pacho Ramos gentoo-dev 2014-01-03 21:45:09 UTC
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
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-03 22:10:23 UTC
(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.
Comment 10 Lucian Muresan 2014-01-03 23:03:38 UTC
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).