[systemd-devel] Starting touchscreen cal after touchscreen device starts

Lennart Poettering lennart at poettering.net
Mon Sep 9 18:26:35 PDT 2013


On Fri, 30.08.13 23:24, Paul D. DeRocco (pderocco at ix.netcom.com) wrote:

> I've got a Gumstix system that uses an LCD and a touchscreen, but without
> a desktop manager. I've created a service to load touchscreen cal data, or
> launch the calibrator program if it doesn't exist, but I can't figure out
> how to ensure that it starts after the touchscreen device appears. I think
> the standard Gumstix build has the desktop manager launch it, so there's
> probably a pretty long chain of dependencies involved when doing it that
> way.
> 
> My boot log shows the following line when the touchscreen is recognized.
> 
> [    9.447113] input: ADS7846 Touchscreen as 
> /devices/platform/omap2_mcspi.1/spi_master/spi1/spi1.0/input/input0
> 
> Unfortunately, this happens after my touchscreen calibrator service starts
> up (and fails).
> 
> There doesn't appear to be any automatically generated systemd unit for
> this device. What's the best way to ensure that my service is launched
> after this device comes online?

This is all running privileged? If so, then you should just add a
"systemd" tag to the input device in udev (which makes it show up in
systemd as device unit), then edit your calibrator unit file and add
Requires=foo.device and After=foo.device, where you replace foo.device
by the device unit name.

See /usr/lib/udev/rules.d/99-systemd.rules for examples how to add the
"systemd" tag to udev devices, as it does so for multiple different
device types...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list