lircmd is not started properly by lirc init script when devinput is used

Bug #783202 reported by Bengt Nilsson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lirc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: lirc

lircmd (lirc mouse daemon) must be started with the -u option when devinput is used.

This is not done correctly by the /etc/init.d/lirc startup script if the lircmd is started by specifiying

    START_LIRCMD="true"

in /etc/lirc/hardware.conf.

If /etc/init.d/lirc:

  if [ "$START_LIRCMD" = "true" ]; then
   [ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
   log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
   start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircmd < /dev/null
   log_end_msg $?
  fi

is changed to

  if [ "$START_LIRCMD" = "true" ]; then
   [ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
   log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
   start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircmd -- -u < /dev/null
   log_end_msg $?
  fi

it works in devinput mode . (there is also a restart section further down that needs editing)

However, this is not the right way to do it in the general case, since it will not work if devinput is NOT used.
Some trick to select when to use/not to use the "-u" switch must be applied.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: lirc 0.8.7-0ubuntu4.1
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
CheckboxSubmission: 6685460b8fac740db235bfc82bb22a5d
CheckboxSystem: fc73f07fcd9845bb95fa3ca6b8be7ef2
Date: Sun May 15 23:18:42 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 LANGUAGE=en
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lirc
UpgradeStatus: Upgraded to natty on 2011-05-03 (12 days ago)

Revision history for this message
Bengt Nilsson (bengt-nilsson11) wrote :
Revision history for this message
Hawk (beehock) wrote :

The following check might help.

                if [ "$START_LIRCMD" = "true" ]; then
                        [ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
                        LIRCMD_ARG=""
                        REMOTE_DEVICE_TYPE=`echo $REMOTE_DEVICE | cut -c 1-10`
                        # Start lircmd to generate Linux Input event if remote device is using devinput
                        if [ "$REMOTE_DEVICE_TYPE" = "/dev/input" ]; then
                                LIRCMD_ARG="--uinput"
                        fi
                        log_daemon_msg $LIRCMD_ARG
                        log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
                        start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircmd $LIRCMD_ARG < /dev/null
                        log_end_msg $?
                fi

Revision history for this message
Bengt Nilsson (bengt-nilsson11) wrote : Re: [Bug 783202] Re: lircmd is not started properly by lirc init script when devinput is used
Download full text (3.4 KiB)

In principle yes, but it did not work exactly as written.
But it works if you replace

 LIRCMD_ARG="--uinput"

with

 LIRCMD_ARG="-- --uinput"

I applied your mod both in start and restart section, and it worked (with my fix).

Please include this in the next distro.

16 maj 2011 kl. 07.31 skrev Hock:

> The following check might help.
>
> if [ "$START_LIRCMD" = "true" ]; then
> [ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
> LIRCMD_ARG=""
> REMOTE_DEVICE_TYPE=`echo $REMOTE_DEVICE | cut -c 1-10`
> # Start lircmd to generate Linux Input event if remote device is using devinput
> if [ "$REMOTE_DEVICE_TYPE" = "/dev/input" ]; then
> LIRCMD_ARG="--uinput"
> fi
> log_daemon_msg $LIRCMD_ARG
> log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
> start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircmd $LIRCMD_ARG < /dev/null
> log_end_msg $?
> fi
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/783202
>
> Title:
> lircmd is not started properly by lirc init script when devinput is
> used
>
> Status in “lirc” package in Ubuntu:
> New
>
> Bug description:
> Binary package hint: lirc
>
> lircmd (lirc mouse daemon) must be started with the -u option when
> devinput is used.
>
> This is not done correctly by the /etc/init.d/lirc startup script if
> the lircmd is started by specifiying
>
> START_LIRCMD="true"
>
> in /etc/lirc/hardware.conf.
>
> If /etc/init.d/lirc:
>
> if [ "$START_LIRCMD" = "true" ]; then
> [ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
> log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
> start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircmd < /dev/null
> log_end_msg $?
> fi
>
> is changed to
>
> if [ "$START_LIRCMD" = "true" ]; then
> [ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
> log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
> start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircmd -- -u < /dev/null
> log_end_msg $?
> fi
>
> it works in devinput mode . (there is also a restart section further
> down that needs editing)
>
> However, this is not the right way to do it in the general case, since it will not work if devinput is NOT used.
> Some trick to select when to use/not to use the "-u" switch must be applied.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 11.04
> Package: lirc 0.8.7-0ubuntu4.1
> ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
> Uname: Linux 2.6.38-8-generic x86_64
> NonfreeKernelModules: nvidia
> Architecture: amd64
> CheckboxSubmission: 6685460b8fac740db235bfc82bb22a5d
> CheckboxSystem: fc73f07fcd9845bb95fa3ca6b8be7ef2
> Date: Sun May 15 23:18:42 2011
> InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
> ProcEnviron:
> LANGUAGE=e...

Read more...

Revision history for this message
Alec Leamas (leamas-alec) wrote :

This bug is more or less obsoleted ny the new 0.9.4c release which has a completely new configuration system based on systemd and a new file lirc_options.conf.

Revision history for this message
Alec Leamas (leamas-alec) wrote :
Download full text (3.1 KiB)

The bug is five years old, the buggy init scripts described are not present in current systemd start up configuration and the patches does thus not apply. I'm closing this one, referring to the 0.9.4c changelog.

lirc (0.9.4b-0.1) experimental; urgency=medium

  * Non-maintainer upload.
  * First shot on major upstream updates.
    - Re-packaged from scratch based on new dh primitives.
    - Thanks for help on debian-mentors!
  * New upstream release 0.9.4
    - Release 0.9.1 .. 0.9.3 was never packaged.
    - Old 'lirc' service split into separate systemd services:
      lircd.service, lircmd.service and irexec.service.
    - Remote definitions moved out of lirc to new project
      lirc-remotes; affects large number of LP issues.
    - Builds also on FreeBSD 10.3.
    - Fixes "Not updated to last version" (Closes: #777199),
      LP: #1443590.
    - Fixes "Default device for mode2 is /dev/lirc" (Closes: #702140).
    - Fixes "/var/run/lirc contents disappear..." (Closes: #676343).
    - Fixes "lircrcd segfaults" (Closes: #780062).
    - Fixes "'/etc/init.d/lirc restart' is broken" (Closes: #782091).
    - Fixes "Prompting due to modified conffiles..." (Closes: #655969).
    - Fixes "LIRC installs bad udev rule" (Closes: #804397),
      users depending on this rule will need to explicitly start lircd.
    - Fixes "lirc init script can create circular symlinks", LP: #698007.
    - Fixes "Update Uploaders List (Closes: #762554).
    - Fixes "Please switch to libftdi1" (Closes: #810370).
    - Fixes LP: #153457 "iguanaIR support not functional".
    - Fixes LP: #460027 "using lirc init script restart function fails
      sometimes".
    - Fixes LP: #499588 "lirc udev rule causes unreliable startup".
    - Fixes LP: #567519 "lircd(8) mentions non-existent
      /dev/input/uinput".
    - Fixes LP: #1029604 "mce remote doesn't work due to out of date
      lircd.conf.devinput".
    - Fixes LP: #1312287 "lircd start problem".
  * The built-in irman support is moved to the lirc-drv-irman package.
  * Revised package structure: keep old liblircclient0 (renamed to
    liblirc-client0). Adding new packages liblirc0, liblirc-dev and
    lirc-doc. Former liblircclient-dev merged into new liblirc-dev.
  * Don't overwrite existing lircd.conf file.
  * Ship sysV scripts from the svn tree [Stefan Lippers-Hollmann]
  * Add handling of obsolete 0.9.0 udev rule restarting lircd
  * Old lircd output socket link /dev/lirc dropped. Use
    /var/run/lirc/lircd.
  * Updated copyright
  * Update compiler flags: -Wl,as-needed + hardening
    [Stefan Lippers-Hollmann]
  * Avoid negative architecture deps like [!hurd] (Closes: #634807)
    [Stefan Lippers-Hollmann]
  * Add patch 0007-tools-remove-configs-symlink.patch + explicit link
    to walk around #801719 (dh_python3 shortcomings).
  * Last parts of libirman dependencies removed.
  * Changing Vcs-* headers to point to upstream packaging branch.
  * Fixes existing large number of upgrade bugs.
  * Enhance hardening flags.
  * Add a lintian pbuilder test, this requires --hookdir and B92-test-pkg
    therein.
  * Tested (build-wise) on stretch and sid.

 -- Alec Leamas <email address hidden> Thu, 26 May 2016 11:14...

Read more...

Changed in lirc (Ubuntu):
status: New → Fix Committed
Changed in lirc (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.