aboutsummaryrefslogtreecommitdiffhomepage
path: root/rcd
diff options
context:
space:
mode:
authorn-connect <[email protected]>2023-03-03 01:10:09 +0100
committerGitHub <[email protected]>2023-03-03 01:10:09 +0100
commit7dd812c79a7a95f375910045abac9f70a7a748bc (patch)
treeb5e94a49523a1b55d8545053b0ec9da29154e084 /rcd
parent9d524443eca89d987fbf7a502e4537be28215cf0 (diff)
downloadrustdesk-server-7dd812c79a7a95f375910045abac9f70a7a748bc.tar.gz
rustdesk-server-7dd812c79a7a95f375910045abac9f70a7a748bc.zip
hbbr logging to file
Logging enabled via file redirection (not syslog, as it can't tell/pass the logger program's name)
Diffstat (limited to 'rcd')
-rw-r--r--rcd/rustdesk-hbbr15
1 files changed, 12 insertions, 3 deletions
diff --git a/rcd/rustdesk-hbbr b/rcd/rustdesk-hbbr
index ccdf719..906d45e 100644
--- a/rcd/rustdesk-hbbr
+++ b/rcd/rustdesk-hbbr
@@ -15,6 +15,7 @@
# Default is "root".
# rustdesk_hbbr_group (string): Set group that rustdesk_hbbr will run under
# Default is "wheel".
+
. /etc/rc.subr
name=rustdesk_hbbr
@@ -33,7 +34,7 @@ command=/usr/sbin/daemon
procname=/usr/local/sbin/hbbr
rustdesk_hbbr_chdir="/var/lib/rustdesk-server/"
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
@@ -48,8 +49,16 @@ rustdesk_hbbr_startprecmd()
chown -R ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${rustdesk_hbbr_chdir};
chmod -R 770 ${rustdesk_hbbr_chdir};
else
- mkdir -m 7et nonu
-0 ${rustdesk_hbbr_chdir};
+ mkdir -m 770 ${rustdesk_hbbr_chdir};
chown ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${rustdesk_hbbr_chdir};
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"