Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sunlewuyou opened this issue Aug 6, 2024 · 4 comments

Comments

@sunlewuyou
Copy link

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
Copy link
Collaborator

Ok.

Do you have suggestions for a fix?

@sunlewuyou
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

sunlewuyou commented Aug 7, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants