Bug 1234155
| Summary: | lircmd starts from command line but not from systemd | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Mark Mayfield <mayfield_mark> |
| Component: | lirc | Assignee: | Alec Leamas <leamas.alec> |
| Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | high | ||
| Version: | 22 | CC: | bnocera, jarodwilson, leamas.alec, raveit65.sun |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-06-28 16:30:13 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Mark Mayfield
2015-06-21 18:46:59 UTC
Hm... odd, as they say. We need better understand what the problem is. What does "journalctl -b 0 /usr/sbin/lircmd" say? when started from cli lots of Jun 23 20:00:06 localhost.localdomain lircd-0.9.2a[31363]: "lircmd.c":395: Bad file descriptor Jun 23 20:00:06 localhost.localdomain lircd-0.9.2a[31363]: "lircmd.c":395: Bad file descriptor Jun 23 20:00:06 localhost.localdomain lircd-0.9.2a[31363]: "lircmd.c":395: Bad file descriptor Jun 23 20:00:06 localhost.localdomain lircd-0.9.2a[31363]: "lircmd.c":395: Bad file descriptor Jun 23 20:00:06 localhost.localdomain lircd-0.9.2a[31363]: "lircmd.c":395: Bad file descriptor after trying to start with systemd No additional ouput There should be more in the logs... What about the "systemctl status -l lircmd.service" output after starting lircmd.service? Looking at the lircmd code I filed https://sourceforge.net/p/lirc/tickets/104. after starting with service disabled ● lircmd.service - LIRC Infrared Mouse Event Signal Decoder Loaded: loaded (/usr/lib/systemd/system/lircmd.service; disabled; vendor preset: disabled) Active: inactive (dead) Jun 26 23:51:46 localhost.localdomain systemd[1]: Started LIRC Infrared Mouse Event Signal Decoder. after starting with service enabled ● lircmd.service - LIRC Infrared Mouse Event Signal Decoder Loaded: loaded (/usr/lib/systemd/system/lircmd.service; enabled; vendor preset: disabled) Active: inactive (dead) since Fri 2015-06-26 23:52:29 CDT; 2s ago Process: 21817 ExecStart=/usr/sbin/lircmd -u (code=exited, status=0/SUCCESS) Main PID: 21817 (code=exited, status=0/SUCCESS) CGroup: /system.slice/lircmd.service Jun 26 23:52:29 localhost.localdomain systemd[1]: Started LIRC Infrared Mouse Event Signal Decoder. You have modified the lircmd.service file, right? Either by editing /lib/systemd/system/lircmd.service (bad way) or adding a /etc/systemd/system/lircmd.service file (the good way)? The problem seems to be that lircmd misses the --nodaemon argument. This is present in the original lircmd.service file, but seems absent in the options used by systemd here. It's needed, because lircmd runs as a "Type=simple" kind of service which is not supposed to fork. However, without --nodaemon lircmd forks a child and exits. Not really sure what systemd does with the child process in this situation. But overall, this seems like a systemd configuration error (?) If you cannot get things running using this input, please post the lircmd.service file used. I edited sudo vim /etc/systemd/system/multi-user.target.wants/lircmd.service when the service was enabled. But only because the service was not working. I had removed the nodaemon trying to get it running. I changed back and --nodaemon is the only option passed to lircmd. This works from the command line with sudo lircmd --nodaemon, but the service still doesn't work through systemd. These are the contents of my current lircmd.service file [Unit] Description=LIRC Infrared Mouse Event Signal Decoder After=network.target [Service] Type=simple ExecStart=/usr/sbin/lircmd --nodaemon [Install] WantedBy=multi-user.target The output of sudo systemctl status -l lircmd.service after systemctl start lircmd.service ● lircmd.service - LIRC Infrared Mouse Event Signal Decoder Loaded: loaded (/usr/lib/systemd/system/lircmd.service; enabled; vendor preset: disabled) Active: inactive (dead) since Sat 2015-06-27 07:56:04 CDT; 1min 1s ago Process: 27758 ExecStart=/usr/sbin/lircmd --nodaemon (code=exited, status=0/SUCCESS) Main PID: 27758 (code=exited, status=0/SUCCESS) CGroup: /system.slice/lircmd.service Jun 27 07:56:04 localhost.localdomain systemd[1]: Started LIRC Infrared Mouse Event Signal Decoder. Spotted another change I made trying to make it work. I recreated the service file from a fresh lirc install on another system. Contents: [Unit] Description=LIRC Infrared Mouse Event Signal Decoder Wants=lircd.socket [Service] Type=simple ExecStart=/usr/sbin/lircmd --nodaemon [Install] WantedBy=multi-user.target issue persists found it. It's a bug in the option parsing code around line 783 in lircmd.cpp. It sets the "lircd:nodaemon" insread of "lircmd:nodaemon" and so on. Most likely a copy-paste error. Stay tuned, a patch is under way (although it can take some time). Fixed upstream in https://sourceforge.net/p/lirc/git/ci/5e494bf49825177c. Can you rebuild lirc using the instructions in CONTRIBUTE.md? I'm about to have summer holidays, not sure if I can land new rpms before that. hm... I have managed to make a provisionary upstream release 0.9.3pre1. There are test rpms available at https://copr.fedoraproject.org/coprs/leamas/lirc-0.9.3preview. Using these, your problem should be fixed. If problem persists, please report upstream at https://sourceforge.net/projects/lirc/ |