Make ambed.service systemd native. This allows to make xlx start when ambed.service is fully started up.

This commit is contained in:
Fabian Franz 2024-07-19 13:37:47 +02:00
parent bad324fdcf
commit bbe62c9ca9
4 changed files with 7 additions and 2 deletions

View file

@ -27,6 +27,7 @@
#include "ccontroller.h"
#include "cvocodecs.h"
#include "cambeserver.h"
#include <systemd/sd-daemon.h>
////////////////////////////////////////////////////////////////////////////////////////
@ -81,6 +82,7 @@ bool CAmbeServer::Start(void)
{
//
m_pThread = new std::thread(CAmbeServer::Thread, this);
sd_notify(0, "READY=1");
}
// done

View file

@ -25,6 +25,7 @@
#include "main.h"
#include <string.h>
#include "cvocodecs.h"
#include <systemd/sd-daemon.h>
////////////////////////////////////////////////////////////////////////////////////////
// global object
@ -243,10 +244,12 @@ bool CVocodecs::Init(void)
if ( ok )
{
std::cout << "Codec interfaces initialized successfully : " << iNbCh << " channels available" << std::endl;
sd_notifyf(0, "STATUS=Codec interfaces initialized successfully : %i channels available", iNbCh);
}
else
{
std::cout << "At least one codec interfaces failed to initialize : " << iNbCh << " channels availables" << std::endl;
sd_notifyf(0, "At least one codec interfaces failed to initialize : %i channels availables", iNbCh);
}
// done
return ok;

View file

@ -8,7 +8,7 @@ EXECUTABLE=ambed
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -lftd2xx -Wl,-rpath,/usr/local/lib -o $@
$(CC) $(LDFLAGS) $(OBJECTS) -lftd2xx -I/usr/src/libftd2xx-x86_64-1.4.27 -Wl,-rpath,/usr/local/lib -lsystemd -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@

View file

@ -3,7 +3,7 @@ Description=AMBE Transcoder Daemon
After=network.target
[Service]
Type=simple
Type=notify
User=root
Group=root
ExecStartPre=-/sbin/rmmod ftdi_sio