From 8fb825a984a8b641d0956d3bd3228d70378a2068 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Tue, 11 Jun 2024 12:17:01 -0600 Subject: [PATCH] Notify systemd that the service is started --- libs/rm2fb/Server.cpp | 2 ++ libs/rm2fb/rm2fb.service | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libs/rm2fb/Server.cpp b/libs/rm2fb/Server.cpp index 156d215..bd02a43 100644 --- a/libs/rm2fb/Server.cpp +++ b/libs/rm2fb/Server.cpp @@ -288,7 +288,9 @@ serverMain(int argc, char* argv[], char** envp) { // NOLINT const auto fixedFdNum = 1 + (tcpFd.has_value() ? 1 : 0); std::vector pollfds; + sd_notify(0, "READY=1"); std::cout << "rm2fb-server started!\n"; + while (running) { pollfds.clear(); pollfds.reserve(tcpClients.size() + fixedFdNum); diff --git a/libs/rm2fb/rm2fb.service b/libs/rm2fb/rm2fb.service index cfd69b0..9d7063e 100644 --- a/libs/rm2fb/rm2fb.service +++ b/libs/rm2fb/rm2fb.service @@ -4,8 +4,10 @@ StartLimitIntervalSec=600 StartLimitBurst=4 Before=xochitl.service launcher.service remarkable-reboot.service remarkable-shutdown.service After=opt.mount +ConditionFileNotEmpty=/opt/lib/librm2fb_server.so [Service] +Type=notify Restart=on-failure RestartSec=5 ExecStart=/usr/bin/xochitl