Skip to content

Commit a0eca0d

Browse files
iiod: fix service start
make sure iiod service is enabled even if only hwmon devices are present Signed-off-by: Cristina Suteu <[email protected]>
1 parent bdd5c00 commit a0eca0d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

iiod/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ if(NOT SKIP_INSTALL_ALL)
9090
endif()
9191

9292
if (WITH_SYSTEMD)
93+
if(${WITH_HWMON})
94+
set(CMAKE_SERVICE_PATH "ConditionPathExists=|/sys/bus/iio\nConditionPathExists=|/sys/class/hwmon")
95+
else()
96+
set(CMAKE_SERVICE_PATH "ConditionPathExists=/sys/bus/iio")
97+
endif()
9398
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/init/iiod.service.cmakein ${PROJECT_BINARY_DIR}/init/iiod.service)
9499
install(FILES ${PROJECT_BINARY_DIR}/init/iiod.service DESTINATION ${SYSTEMD_UNIT_INSTALL_DIR})
95100
endif()

iiod/init/iiod.service.cmakein

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Description=IIO Daemon
99
Requires=systemd-udev-settle.service
1010
After=network.target systemd-udev-settle.service
11-
ConditionPathExists=/sys/bus/iio
11+
@CMAKE_SERVICE_PATH@
1212

1313
[Service]
1414
Environment=$IIOD_EXTRA_OPTS=''

0 commit comments

Comments
 (0)