hbbr logging to file

Logging enabled via file redirection (not syslog, as it can't tell/pass the logger program's name)
This commit is contained in:
n-connect 2023-03-03 01:10:09 +01:00 committed by GitHub
parent 9d524443ec
commit 7dd812c79a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@
# Default is "root". # Default is "root".
# rustdesk_hbbr_group (string): Set group that rustdesk_hbbr will run under # rustdesk_hbbr_group (string): Set group that rustdesk_hbbr will run under
# Default is "wheel". # Default is "wheel".
. /etc/rc.subr . /etc/rc.subr
name=rustdesk_hbbr name=rustdesk_hbbr
@ -33,7 +34,7 @@ command=/usr/sbin/daemon
procname=/usr/local/sbin/hbbr procname=/usr/local/sbin/hbbr
rustdesk_hbbr_chdir="/var/lib/rustdesk-server/" rustdesk_hbbr_chdir="/var/lib/rustdesk-server/"
rustdesk_hbbr_args="-k _" rustdesk_hbbr_args="-k _"
command_args="-f -p ${pidfile} /usr/bin/env ${procname} ${rustdesk_hbbr_args}" command_args="-p ${pidfile} -o /var/log/rustdesk-hbbr.log ${procname} ${rustdesk_hbbr_args}"
start_precmd=rustdesk_hbbr_startprecmd start_precmd=rustdesk_hbbr_startprecmd
@ -48,8 +49,16 @@ rustdesk_hbbr_startprecmd()
chown -R ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${rustdesk_hbbr_chdir}; chown -R ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${rustdesk_hbbr_chdir};
chmod -R 770 ${rustdesk_hbbr_chdir}; chmod -R 770 ${rustdesk_hbbr_chdir};
else else
mkdir -m 7et nonu mkdir -m 770 ${rustdesk_hbbr_chdir};
0 ${rustdesk_hbbr_chdir};
chown ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${rustdesk_hbbr_chdir}; chown ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${rustdesk_hbbr_chdir};
fi fi
if [ -e /var/log/rustdesk-hbbr.log ]; then
chown -R ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} /var/log/rustdesk-hbbr.log;
chmod 660 /var/log/rustdesk-hbbr.log;
else
install -o ${rustdesk_hbbr_user} -g ${rustdesk_hbbr_group} /dev/null /var/log/rustdesk-hbbr.log;
chmod 660 /var/log/rustdesk-hbbr.log;
fi
} }
run_rc_command "$1"