diff options
author | RustDesk <[email protected]> | 2023-03-03 10:32:00 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2023-03-03 10:32:00 +0800 |
commit | 13321b5a9044a01d4f39f2374b514f7c5f0d8dcc (patch) | |
tree | 6a6d2b108f818fe26bc2e8a809a678199ab2a250 | |
parent | 9d524443eca89d987fbf7a502e4537be28215cf0 (diff) | |
parent | 0a8c39c11fb04480a0800fc2fe814f016ec87958 (diff) | |
download | rustdesk-server-13321b5a9044a01d4f39f2374b514f7c5f0d8dcc.tar.gz rustdesk-server-13321b5a9044a01d4f39f2374b514f7c5f0d8dcc.zip |
Merge pull request #210 from n-connect/master
Log files enables
-rw-r--r-- | rcd/rustdesk-hbbr | 15 | ||||
-rw-r--r-- | rcd/rustdesk-hbbs | 11 |
2 files changed, 21 insertions, 5 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" diff --git a/rcd/rustdesk-hbbs b/rcd/rustdesk-hbbs index 0d3576d..2b13080 100644 --- a/rcd/rustdesk-hbbs +++ b/rcd/rustdesk-hbbs @@ -33,8 +33,8 @@ pidfile=/var/run/rustdesk_hbbs.pid command=/usr/sbin/daemon procname=/usr/local/sbin/hbbs rustdesk_hbbs_chdir="/var/lib/rustdesk-server/" -rustdesk_hbbs_args="-r your.ip.add.ress -k _" -command_args="-f -p ${pidfile} /usr/bin/env ${procname} ${rustdesk_hbbs_args}" +rustdesk_hbbs_args="-r 130.255.77.37 -k _" +command_args="-p ${pidfile} -o /var/log/rustdesk-hbbs.log ${procname} ${rustdesk_hbbs_args}" start_precmd=rustdesk_hbbs_startprecmd @@ -52,6 +52,13 @@ rustdesk_hbbs_startprecmd() mkdir -m 770 ${rustdesk_hbbs_chdir}; chown ${rustdesk_hbbs_user}:${rustdesk_hbbs_group} ${rustdesk_hbbs_chdir}; fi + if [ -e /var/log/rustdesk-hbbs.log ]; then + chown -R ${rustdesk_hbbs_user}:${rustdesk_hbbs_group} /var/log/rustdesk-hbbs.log; + chmod 660 /var/log/rustdesk-hbbs.log; + else + install -o ${rustdesk_hbbs_user} -g ${rustdesk_hbbs_group} /dev/null /var/log/rustdesk-hbbs.log; + chmod 660 /var/log/rustdesk-hbbs.log; + fi } run_rc_command "$1" |