From d91a52c6ba0e6607b37779e1a6fa71025415176a Mon Sep 17 00:00:00 2001 From: lukas-heiligenbrunner Date: Wed, 23 Oct 2019 13:18:43 +0200 Subject: [PATCH] created systemd service --- CMakeLists.txt | 1 + iprefresher.service | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 iprefresher.service diff --git a/CMakeLists.txt b/CMakeLists.txt index e9c30ac..04f7030 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ target_link_libraries(iprefresher api logger ${CURL_LIBRARIES} ) # INSTALL to SYSTEM # install (TARGETS iprefresher DESTINATION bin) +install(FILES ./iprefresher.service DESTINATION /lib/systemd/system/) SET(CPACK_DEB_COMPONENT_INSTALL 1) diff --git a/iprefresher.service b/iprefresher.service new file mode 100644 index 0000000..203ab3a --- /dev/null +++ b/iprefresher.service @@ -0,0 +1,12 @@ +[Unit] +Description=IP Refresher +After=network.target +[Service] +ExecStart=iprefresher -l +WorkingDirectory=/root +StandardOutput=inherit +StandardError=inherit +Restart=always +User=root +[Install] +WantedBy=multi-user.target \ No newline at end of file