From f279ddedcac3e9b77ab742c57a37bbdcbabe7a82 Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Fri, 26 May 2023 00:44:39 +0100 Subject: Add systemd services and rename executable --- daemon/CMakeLists.txt | 9 ++++++--- daemon/systemd/asteroid-sensorlogd.service | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 daemon/systemd/asteroid-sensorlogd.service diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 7d38132..e38052b 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(healthd +add_executable(sensorlogd sensorlogd.cpp logger.cpp logger.h @@ -7,6 +7,9 @@ add_executable(healthd sensorPlugins/heartrateSensor.cpp sensorPlugins/heartrateSensor.h ) -set_target_properties(healthd PROPERTIES AUTOMOC ON) +set_target_properties(sensorlogd PROPERTIES AUTOMOC ON) #add_compile_definitions(Q_DECLARE_PRIVATE_SUPPORTS_UNIQUE_PTR=${Q_DECLARE_PRIVATE_SUPPORTS_UNIQUE_PTR}) -target_link_libraries(healthd PRIVATE Qt5::Core Qt5::DBus Qt5::Qml Qt5::Positioning Qt5::Sensors) +target_link_libraries(sensorlogd PRIVATE Qt5::Core Qt5::DBus Qt5::Qml Qt5::Positioning Qt5::Sensors) +install(TARGETS sensorlogd DESTINATION bin) +install(FILES systemd/asteroid-sensorlogd.service + DESTINATION /usr/lib/systemd/user) diff --git a/daemon/systemd/asteroid-sensorlogd.service b/daemon/systemd/asteroid-sensorlogd.service new file mode 100644 index 0000000..56a165b --- /dev/null +++ b/daemon/systemd/asteroid-sensorlogd.service @@ -0,0 +1,8 @@ +[Unit] +Description=Sensor logger for AsteroidOS + +[Service] +ExecStart=/usr/bin/sensorlogd + +[Install] +WantedBy=basic.target -- cgit v1.2.3-70-g09d2