Open rc support
I am running openrc on debian. How would I write a service file that supports iptsd so I caould use touch?
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?
Could you post the full error message? Did you also remove the systemd dependency from the package dependencies?
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
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
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.
Because you set OPENRC_DIR to /run/openrc and then in the next line check if it equals linux which can never be true
Ah yeah thanks.
Building the package with eiher openrc or systemd works now. Can my changes be merged/added?
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
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.
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
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