techahold / rustdeskinstall

Easy install Script for Rustdesk
MIT License
397 stars 117 forks source link

Older versions of systemd do not support StandardOutput and StandardError #85

Open sunlewuyou opened 3 months ago

sunlewuyou commented 3 months ago

The systemd version is too old and does not support directly outputting StandardOutput and StandardError to files.

18:08:26 centos7 systemd[1]: [/etc/systemd/system/rustdesksignal.service:11] Failed to parse output specifier, ignoring: append:/var/log/rustdesk/signalserver.log
18:08:26 centos7 systemd[1]: [/etc/systemd/system/rustdesksignal.service:12] Failed to parse output specifier, ignoring: append:/var/log/rustdesk/signalserver.error

systemd 219
dinger1986 commented 3 months ago

Ok.

Do you have suggestions for a fix?

sunlewuyou commented 3 months ago

Ok.

Do you have suggestions for a fix?

I found out that rsyslog can be used. I hope the script can be improved. Thank you!

dinger1986 commented 3 months ago

ok, if anyone can find out the input and make suggestions that will be fine, I dont use Centos and dont have loads of time to find the fix

sunlewuyou commented 3 months ago

@dinger1986 My Configuration:

# cat /etc/systemd/system/rustdesksignal.service
[Unit]
Description=Rustdesk Signal Server

[Service]
Type=simple
LimitNOFILE=1000000
ExecStart=/opt/rustdesk/hbbs -k _
WorkingDirectory=/opt/rustdesk/
User=root
Group=root
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=signalserver
Restart=always
# Restart service after 10 seconds if node service crashes
RestartSec=10

[Install]
WantedBy=multi-user.target

# cat /etc/rsyslog.d/signalserver.conf
if $programname == 'signalserver' then /var/log/rustdesk/signalserver.log
& stop

if $programname == 'signalserver' then /var/log/rustdesk/signalserver.error
& stop

# cat /etc/systemd/system/rustdeskrelay.service
[Unit]
Description=Rustdesk Relay Server

[Service]
Type=simple
LimitNOFILE=1000000
ExecStart=/opt/rustdesk/hbbr -k _
WorkingDirectory=/opt/rustdesk/
User=root
Group=root
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=relayserver
Restart=always
# Restart service after 10 seconds if node service crashes
RestartSec=10

[Install]
WantedBy=multi-user.target

# cat /etc/rsyslog.d/relayserver.conf
if $programname == 'relayserver' then /var/log/rustdesk/relayserver.log
& stop

if $programname == 'relayserver' then /var/log/rustdesk/relayserver.error
& stop