logantgt / EcpEmuServer

Trigger webhooks from your Logitech Harmony (or other Roku ECP compatible) Universal Remote
MIT License
19 stars 2 forks source link

Run as Daemon on Debian #8

Open marcolino7 opened 4 months ago

marcolino7 commented 4 months ago

Hi, I am trying to run EpcEmuServer like a Daemon on Debian. I created a service with systemd, EcpEmuServer start but systemd will be not aware if EcpEmuServer is started and systemd timeout and restart EcpEmuServer. Is there a way to run like a daemon without human interacting? Thanks

gklank commented 3 months ago

Hi,

I did it with:

/etc/systemd/system/EcpEmuServer.service [Unit] Description=Starting the Harmony Haus AutomationEcpEmuServer.service After=multi-user.target

[Service] ExecStart=/usr/bin/bash /srv/debian/EcpEmuServer-linux_x64/EcpEmuServer.sh Type=simple

[Install] WantedBy=multi-user.target

systemctl enable EcpEmuServer.service systemctl start EcpEmuServer.service

Regards

Gerhard

marcolino7 commented 2 months ago

Hi,

I did it with:

/etc/systemd/system/EcpEmuServer.service [Unit] Description=Starting the Harmony Haus AutomationEcpEmuServer.service After=multi-user.target

[Service] ExecStart=/usr/bin/bash /srv/debian/EcpEmuServer-linux_x64/EcpEmuServer.sh Type=simple

[Install] WantedBy=multi-user.target

systemctl enable EcpEmuServer.service systemctl start EcpEmuServer.service

Regards

Gerhard

Please share also EcpEmuServer.sh file, so I can replicate your configuration

Thanks

gklank commented 2 months ago

Hi,

sorry that I have missed this part:

The script:

!/usr/bin/bash

EcpEmu_DB_DIR=/srv/debian/EcpEmuServer-linux_x64 EcpEmu_DB_LOG=EcpEmuServer.log

DOTNET_ROOT=/root/.dotnet export DOTNET_ROOT

exec &> $EcpEmu_DB_DIR/$EcpEmu_DB_LOG

LD_LIBRARY_PATH=/usr/lib/dotnet/dotnet6-6.0.110/host/fxr/6.0.10

export LD_LIBRARY_PATH

cd $EcpEmu_DB_DIR

./EcpEmuServer &> /dev/null