-
Notifications
You must be signed in to change notification settings - Fork 260
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
rustdesk-server: add the init.d file for rustdesk-server #1442
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,43 @@ | ||||||||||||||||||||
#!/bin/sh /etc/rc.common | ||||||||||||||||||||
|
||||||||||||||||||||
START=99 | ||||||||||||||||||||
STOP=10 | ||||||||||||||||||||
USE_PROCD=1 | ||||||||||||||||||||
NAME="rustdesk" | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
WORKDIR="/etc/rustdesk" | ||||||||||||||||||||
|
||||||||||||||||||||
start_service() { | ||||||||||||||||||||
if [ ! -d "$WORKDIR" ]; then | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use tabs for indentation. |
||||||||||||||||||||
mkdir -p "$WORKDIR" | ||||||||||||||||||||
if [ $? -ne 0 ]; then | ||||||||||||||||||||
Comment on lines
+11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
i would say this error is unlikely to happen, no need to check here |
||||||||||||||||||||
logger -p daemon.err -t "$NAME" "Failed to create working directory: $WORKDIR" | ||||||||||||||||||||
return 1 | ||||||||||||||||||||
fi | ||||||||||||||||||||
fi | ||||||||||||||||||||
|
||||||||||||||||||||
procd_open_instance "$NAME.server" | ||||||||||||||||||||
procd_set_param cwd "$WORKDIR" | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there's no param called |
||||||||||||||||||||
procd_set_param command sh -c "cd $WORKDIR && /usr/bin/hbbs" | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is... ugly. needs a way to get rid of sh wrapper |
||||||||||||||||||||
procd_set_param respawn | ||||||||||||||||||||
procd_set_param stdout 1 | ||||||||||||||||||||
procd_set_param stderr 1 | ||||||||||||||||||||
procd_close_instance | ||||||||||||||||||||
|
||||||||||||||||||||
procd_open_instance "$NAME.relay" | ||||||||||||||||||||
procd_set_param cwd "$WORKDIR" | ||||||||||||||||||||
procd_set_param command sh -c "cd $WORKDIR && /usr/bin/hbbr" | ||||||||||||||||||||
procd_set_param respawn | ||||||||||||||||||||
procd_set_param stdout 1 | ||||||||||||||||||||
procd_set_param stderr 1 | ||||||||||||||||||||
procd_close_instance | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
stop_service() { | ||||||||||||||||||||
killall hbbs | ||||||||||||||||||||
killall hbbr | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
reload_service() { | ||||||||||||||||||||
stop_service | ||||||||||||||||||||
start_service | ||||||||||||||||||||
} | ||||||||||||||||||||
Comment on lines
+35
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
procd will handle these, drop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add commands for installing the binaries too since you have overridden the default install recipe.
otherwise only this script will be packed.