Make xlxd.service systemd native.

This commit is contained in:
Fabian Franz 2024-07-19 16:13:23 +02:00
parent bbe62c9ca9
commit bf8b205fca
3 changed files with 4 additions and 2 deletions

View file

@ -3,7 +3,7 @@ Description=XLX Reflector (XLX999)
After=network.target ambed.service After=network.target ambed.service
[Service] [Service]
Type=forking Type=notify
User=xlxd User=xlxd
Group=xlxd Group=xlxd
AmbientCapabilities=CAP_NET_RAW AmbientCapabilities=CAP_NET_RAW

View file

@ -31,6 +31,7 @@
#include "ctranscoder.h" #include "ctranscoder.h"
#include "cysfnodedirfile.h" #include "cysfnodedirfile.h"
#include "cysfnodedirhttp.h" #include "cysfnodedirhttp.h"
#include <systemd/sd-daemon.h>
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// constructor // constructor
@ -132,6 +133,7 @@ bool CReflector::Start(void)
#ifdef JSON_MONITOR #ifdef JSON_MONITOR
m_JsonReportThread = new std::thread(CReflector::JsonReportThread, this); m_JsonReportThread = new std::thread(CReflector::JsonReportThread, this);
#endif #endif
sd_notify(0, "READY=1");
} }
else else
{ {

View file

@ -1,6 +1,6 @@
CC=g++ CC=g++
CFLAGS=-c -std=c++11 -pthread CFLAGS=-c -std=c++11 -pthread
LDFLAGS=-std=c++11 -pthread LDFLAGS=-std=c++11 -pthread -lsystemd
SOURCES=$(wildcard *.cpp) SOURCES=$(wildcard *.cpp)
OBJECTS=$(SOURCES:.cpp=.o) OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=xlxd EXECUTABLE=xlxd