-
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?
Conversation
Signed-off-by: Yun <[email protected]>
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 should also introduce uci configuration to control and customize the service.
@@ -30,6 +30,11 @@ define Package/rustdesk-server | |||
URL:=https://rustdesk.com/server | |||
endef | |||
|
|||
define Package/rustdesk-server/install | |||
$(INSTALL_DIR) $(1)/etc/init.d |
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.
START=99 | ||
STOP=10 | ||
USE_PROCD=1 | ||
NAME="rustdesk" |
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.
NAME="rustdesk" | |
NAME="rustdesk" |
WORKDIR="/etc/rustdesk" | ||
|
||
start_service() { | ||
if [ ! -d "$WORKDIR" ]; then |
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.
please use tabs for indentation.
mkdir -p "$WORKDIR" | ||
if [ $? -ne 0 ]; then |
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.
mkdir -p "$WORKDIR" | |
if [ $? -ne 0 ]; then | |
if ! mkdir -p "$WORKDIR"; then |
i would say this error is unlikely to happen, no need to check here
fi | ||
|
||
procd_open_instance "$NAME.server" | ||
procd_set_param cwd "$WORKDIR" |
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.
there's no param called cwd
stop_service() { | ||
killall hbbs | ||
killall hbbr | ||
} | ||
|
||
reload_service() { | ||
stop_service | ||
start_service | ||
} |
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.
stop_service() { | |
killall hbbs | |
killall hbbr | |
} | |
reload_service() { | |
stop_service | |
start_service | |
} |
procd will handle these, drop
|
||
procd_open_instance "$NAME.server" | ||
procd_set_param cwd "$WORKDIR" | ||
procd_set_param command sh -c "cd $WORKDIR && /usr/bin/hbbs" |
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.
this is... ugly. needs a way to get rid of sh wrapper
No description provided.