iptsd icon indicating copy to clipboard operation
iptsd copied to clipboard

Open rc support

Open werdahias opened this issue 4 years ago • 12 comments

I am running openrc on debian. How would I write a service file that supports iptsd so I caould use touch?

werdahias avatar Nov 23 '21 03:11 werdahias

I edited the debian/rules files like this:

#!/usr/bin/make -f

export DH_VERBOSE=1
export SYSTEMD_DIR = /run/systemd

ifeq ($(SYSTEMD_DIR),linux)
CONFFLAGS += \
	-Dservice_manager=systemd
else
CONFFLAGS += \
	-Dservice_manager=openrc
endif
override_dh_strip:
	dh_strip --no-automatic-dbgsym

%:
	dh $@

Yet meson complains about the missing systemd dependency. What am I missing here?

werdahias avatar Nov 23 '21 04:11 werdahias

Could you post the full error message? Did you also remove the systemd dependency from the package dependencies?

StollD avatar Nov 23 '21 14:11 StollD

Sure thing: Here is my modified control file:

Source: iptsd
Section: misc
Priority: optional
Maintainer: Dorian Stoll <[email protected]>
Build-Depends:
 build-essential,
 debhelper (>= 10),
 libinih-dev,
 meson,
 pkg-config,
 systemd | openrc,
 udev

Package: iptsd
Architecture: amd64
Depends: systemd | openrc, udev, libinih1
Description: Userspace daemon for Intel Precise Touch & Stylus

log.txt

werdahias avatar Nov 23 '21 21:11 werdahias

Ok, I figured out why it doesnt work. The CONFFLAGS variable that you define does nothing on its own. You need to pass it to debhelper so that it actually uses it.

override_dh_auto_configure:
	dh_auto_configure -- $(CONFFLAGS)

https://github.com/linux-surface/iptsd/blob/libqzed/debian/rules#L6-L7

StollD avatar Nov 24 '21 07:11 StollD

Thanks, did it like this:

#!/usr/bin/make -f

export DH_VERBOSE=1
export OPENRC_DIR=/run/openrc



ifeq ($(OPENRC_DIR),linux)
CONFFLAGS += \
	-Dservice_manager=openrc
else
CONFFLAGS += \
	-Dservice_manager=systemd
endif

override_dh_auto_configure:
	dh_auto_configure -- $(CONFFLAGS)

override_dh_strip:
	dh_strip --no-automatic-dbgsym

%:
	dh $@

Still get the same error.

werdahias avatar Nov 24 '21 08:11 werdahias

Because you set OPENRC_DIR to /run/openrc and then in the next line check if it equals linux which can never be true

StollD avatar Nov 24 '21 09:11 StollD

Ah yeah thanks.

werdahias avatar Nov 24 '21 09:11 werdahias

Building the package with eiher openrc or systemd works now. Can my changes be merged/added?

changes.zip

werdahias avatar Nov 24 '21 22:11 werdahias

Also a manual symlink is needed for the service to be started on boot time: sudo ln -s /etc/init.d/iptsd /etc/runlevels/default/iptsd

werdahias avatar Nov 25 '21 00:11 werdahias

Sorry for not answering, could you please open a pull request with your changes? I will look at them as soon as I get a chance then.

StollD avatar Dec 01 '21 10:12 StollD

Building the package now works, running it manually gets me errors.


sudo /usr/bin/iptsd -v
ERROR: ../src/control.c:51: Failed to send feedback: No such device
ERROR: ../src/control.c:74: Failed to flush buffers: No such device
ERROR: ../
src/main.c:106: Failed to start IPTS: No such device

And also this:


 sudo rc-service iptsd stop
 * WARNING: you are stopping a boot service
 * Stopping iptsd ...
No /usr/bin/iptsd found running; none killed.
 * Failed to stop iptsd                                                   [ !! ]
 * ERROR: iptsd failed to stop

werdahias avatar Dec 06 '21 00:12 werdahias

Same as running from source, my guess is the ipts module isn't loaded properly:

/iptsd/build$ sudo ./iptsd
ERROR: ../src/control.c:51: Failed to send feedback: No such device
ERROR: ../src/control.c:74: Failed to flush buffers: No such device
ERROR: ../src/main.c:106: Failed to start IPTS: No such device

dmesg: [ 4.285493] ipts 0000:00:16.4-3e8d0870-271a-4208-8eb5-9acb9402ae04: Starting IPTS

werdahias avatar Dec 06 '21 00:12 werdahias