mirror of
https://github.com/LX3JL/xlxd.git
synced 2026-01-03 15:20:20 +01:00
Make ambed.service systemd native. This allows to make xlx start when ambed.service is fully started up.
This commit is contained in:
parent
bad324fdcf
commit
bbe62c9ca9
|
|
@ -27,6 +27,7 @@
|
||||||
#include "ccontroller.h"
|
#include "ccontroller.h"
|
||||||
#include "cvocodecs.h"
|
#include "cvocodecs.h"
|
||||||
#include "cambeserver.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);
|
m_pThread = new std::thread(CAmbeServer::Thread, this);
|
||||||
|
sd_notify(0, "READY=1");
|
||||||
}
|
}
|
||||||
|
|
||||||
// done
|
// done
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "cvocodecs.h"
|
#include "cvocodecs.h"
|
||||||
|
#include <systemd/sd-daemon.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// global object
|
// global object
|
||||||
|
|
@ -243,10 +244,12 @@ bool CVocodecs::Init(void)
|
||||||
if ( ok )
|
if ( ok )
|
||||||
{
|
{
|
||||||
std::cout << "Codec interfaces initialized successfully : " << iNbCh << " channels available" << std::endl;
|
std::cout << "Codec interfaces initialized successfully : " << iNbCh << " channels available" << std::endl;
|
||||||
|
sd_notifyf(0, "STATUS=Codec interfaces initialized successfully : %i channels available", iNbCh);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "At least one codec interfaces failed to initialize : " << iNbCh << " channels availables" << std::endl;
|
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
|
// done
|
||||||
return ok;
|
return ok;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ EXECUTABLE=ambed
|
||||||
all: $(SOURCES) $(EXECUTABLE)
|
all: $(SOURCES) $(EXECUTABLE)
|
||||||
|
|
||||||
$(EXECUTABLE): $(OBJECTS)
|
$(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:
|
.cpp.o:
|
||||||
$(CC) $(CFLAGS) $< -o $@
|
$(CC) $(CFLAGS) $< -o $@
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ Description=AMBE Transcoder Daemon
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=notify
|
||||||
User=root
|
User=root
|
||||||
Group=root
|
Group=root
|
||||||
ExecStartPre=-/sbin/rmmod ftdi_sio
|
ExecStartPre=-/sbin/rmmod ftdi_sio
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue