Skip to content

Commit

Permalink
iiod: fix service start
Browse files Browse the repository at this point in the history
make sure iiod service is enabled even if only hwmon devices are present

Signed-off-by: Cristina Suteu <cristina.suteu@analog.com>
  • Loading branch information
cristina-suteu committed Sep 25, 2024
1 parent bdd5c00 commit a0eca0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions iiod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ if(NOT SKIP_INSTALL_ALL)
endif()

if (WITH_SYSTEMD)
if(${WITH_HWMON})
set(CMAKE_SERVICE_PATH "ConditionPathExists=|/sys/bus/iio\nConditionPathExists=|/sys/class/hwmon")
else()
set(CMAKE_SERVICE_PATH "ConditionPathExists=/sys/bus/iio")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/init/iiod.service.cmakein ${PROJECT_BINARY_DIR}/init/iiod.service)
install(FILES ${PROJECT_BINARY_DIR}/init/iiod.service DESTINATION ${SYSTEMD_UNIT_INSTALL_DIR})
endif()
Expand Down
2 changes: 1 addition & 1 deletion iiod/init/iiod.service.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Description=IIO Daemon
Requires=systemd-udev-settle.service
After=network.target systemd-udev-settle.service
ConditionPathExists=/sys/bus/iio
@CMAKE_SERVICE_PATH@

[Service]
Environment=$IIOD_EXTRA_OPTS=''
Expand Down

0 comments on commit a0eca0d

Please sign in to comment.