File: README.Debian

package info (click to toggle)
lirc 0.10.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 8,364 kB
  • sloc: ansic: 26,717; cpp: 9,066; sh: 5,521; python: 4,362; makefile: 1,034; xml: 63
file content (171 lines) | stat: -rw-r--r-- 6,797 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
## 0.9.4 disruptive update

The configuration is so much changed that updating  from 0.9.0 requires
manual intervention. This could be done using the update scripts or as
a completely manual process. Many users will always need some manual steps.

The outcome of the process is up to four different services by
default controlled by systemd.


### The changes

  - The hardware.conf file is not supported, obsoleted by a new
    lirc_options.conf file and systemd unit definitions.

  - The former single lirc service is replaced with the three systemd
    services lircd.service, lircmd.service and irexec.service. There is
    no counterpart to the 0.9.0 'lirc' service which covered all of these.
    Using a separate transmitter device requires yet another service.

  - 0.9.4 defaults to using systemd for controlling the services. This
    is not just start/stop functionality, systemd is used to implement
    new features and to address shortcomings in 0.9.0. However, traditional
    systemV scripts are also installed and could be used although this
    is less tested and not really documented.

  - Up to 0.9.0 lirc had a small set of often used remote definitions files
    as part of the package at /usr/share/lirc/remotes. These are dropped
    from 0.9.4, see "The lircd.conf file"  below.

  - Previous lirc package installed a udev rule which autostarted lircd
    when a new /dev/lirc* device was created, typically when connecting
    some kind of USB device. This rule is no longer present, users
    depending on lircd needs to start this service explicitly.


### Using the update script

A new update scripts can create the lirc_options.conf file using values
in the existing hardware.conf. If you want to make a non-destructive test
to inspect the results use:

    $ cp -ar /etc/lirc .
    $ LIRC_DRYRUN=1 /usr/share/lirc/lirc-old2new ./lirc

This will update the files in ./lirc and also just echo the systemctl
commands instead of executing them. To perform the update use:

    $ sudo /usr/share/lirc/lirc-old2new

This will use the files in /etc/lirc, updating lirc_options.conf using data
in hardware conf. It will also start and enable lircd.service, lircmd.service
and irexec.service if the corresponding services was enabled in 0.9.0.

After running script check results using

    $ cat /etc/lirc/lirc_options.conf
    $ systemctl status lircd.socket
    $ systemctl status lircmd.service
    $ systemctl status irexec.service

Note that configurations using a separate transmitter device needs to be
handled manually, see below.

You also might need to review your /etc/lirc/lircd.conf file, also below.


### Manual updating

The manual process is not that hard. The first step is to update
lirc_options.conf using the values in hardware.conf. Usually, this is just
'device' and 'driver' but you might have a different setup. Note that the
default driver is 'default' in 0.9.0 whereas it's 'devinput' in 0.9.4.

The [modinit] section contains a single value 'code = '. This is code which
is run by lircd-setup as root before lircd is started. Typical use is
e. g., modprobe(1) and setserial(1) invocations. If in doubts, leave this
as-is.

When the lirc_options is in shape, enable the different services. Note
that most users only run one or two of these.

*lircd* requires /etc/lirc/lircd.conf. In an upgrade scenario, this is
already in place and you could enable, start and check lircd using:

    $ sudo systemctl enable lircd.socket
    $ sudo systemctl start lircd.socket
    $ systemctl status lircd.socket

*irexec* requires /etc/lirc/irexec.lircrc. In an upgrade scenario you should
have the old configuration file lircrc available if irexec is used. Do:

    $ sudo cp /etc/lirc/lircrc /etc/lirc/irexec.lircrc
    $ sudo systemctl enable irexec.service
    $ sudo systemctl start irexec.service
    $ systemctl status irexec.service

*lircmd* requires lircmd.conf. In an upgrade scenario this should already
be in place if this service is used. Enable, start and check using

    $ sudo systemctl enable lircmd.service
    $ sudo systemctl start lircmd.service
    $ systemctl status lircmd.service


### The /etc/lirc/lircd.conf file and /usr/share/lirc/remotes

If you just have copied a remote file and used it as is or with modifications
the file needs no changes.

However, if you have included files from /usr/share/lirc/remotes these are
not available after update. If you need these files for this or other
reasons, they can be restored by installing the lirc-compat-remotes package.

The default configuration file is available as /etc/lirc/lircd.conf.dist.
This file just includes all files in the /etc/lirc/lircd.conf.d. If you
include files from e. g., /usr/share/lirc/remotes the easiest path is
to copy the files to /etc/lircd.conf.d and use the default lircd.conf.

Note that from 0.9.4 all lircd.conf files are supposed to have names like
mceusb.lircd.conf, with a '.lircd.conf' suffix.


### Using a separate transmitter

Using a separate transmitter requires setting up yet another service (i. e.,
a separate lircd instance). This is done by creating a new file like
/etc/systemd/system/lircd-tx.service. An example:

    [Unit]
    Description=LIRC Infrared Signal Decoder (transmitting)
    After=network.target

    [Service]
    Type=simple
    ExecStart=/usr/sbin/lircd --driver=iguanaIR \
                              --device=/var/run/iguanaIR/0 \
                              --output=/var/run/lirc/lircd-tx \
                              --pidfile=/run/lirc/dont-use-lircd-tx.pid \
                              --nodaemon \
                              --allow-simulate

    [Install]
    WantedBy=multi-user.target

The service will use the defaults from the lirc_options.conf file. The
--device, --output and --pidfile must be unique and thus cannot use these
defaults. A configuration file might or might not be needed; the example
uses the default /etc/lirc/lircd.conf.

Once in place this service can be controlled like other services:

    $ sudo systemctl enable lircd-tx.service
    $ sudo systemctl start lircd-tx.service
    $ systemctl status lircd-tx.service


### Re-enabling the udev autostart rule.

The udev rule which autostarts lirc is still available in
/usr/share/lirc/contrib/85-lirc.rules. This can be copied to
/etc/udev/rules.d to re-enable the hotplugging lirc restart. However,
here are dragons:

    - The rule is not compatible with the systemd configuration, the
      sysV scripts must be used to control lirc.
    - The rule is known to cause subtle bugs such as lp: #499588.
    - The rule has never worked for other devices then /dev/lirc* ones.
    - The rule has never worked with multiple /dev/lirc* devices.

-- Alec Leamas <al@jessie.nowhere.net>  Wed, 2 Nov 2016 19:02:10 +0100