From bf8b205fca09250daf14b0f8215551cef5c70d96 Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Fri, 19 Jul 2024 16:13:23 +0200 Subject: [PATCH] Make xlxd.service systemd native. --- scripts/xlxd.service | 2 +- src/creflector.cpp | 2 ++ src/makefile | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/xlxd.service b/scripts/xlxd.service index 7796208..ab43b69 100644 --- a/scripts/xlxd.service +++ b/scripts/xlxd.service @@ -3,7 +3,7 @@ Description=XLX Reflector (XLX999) After=network.target ambed.service [Service] -Type=forking +Type=notify User=xlxd Group=xlxd AmbientCapabilities=CAP_NET_RAW diff --git a/src/creflector.cpp b/src/creflector.cpp index a813df9..8431203 100644 --- a/src/creflector.cpp +++ b/src/creflector.cpp @@ -31,6 +31,7 @@ #include "ctranscoder.h" #include "cysfnodedirfile.h" #include "cysfnodedirhttp.h" +#include //////////////////////////////////////////////////////////////////////////////////////// // constructor @@ -132,6 +133,7 @@ bool CReflector::Start(void) #ifdef JSON_MONITOR m_JsonReportThread = new std::thread(CReflector::JsonReportThread, this); #endif + sd_notify(0, "READY=1"); } else { diff --git a/src/makefile b/src/makefile index 2d7b587..89304c9 100644 --- a/src/makefile +++ b/src/makefile @@ -1,6 +1,6 @@ CC=g++ CFLAGS=-c -std=c++11 -pthread -LDFLAGS=-std=c++11 -pthread +LDFLAGS=-std=c++11 -pthread -lsystemd SOURCES=$(wildcard *.cpp) OBJECTS=$(SOURCES:.cpp=.o) EXECUTABLE=xlxd