Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AutoCONFIG
Copy link

No description provided.

Copy link
Member

@1715173329 1715173329 left a 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
Copy link
Member

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NAME="rustdesk"
NAME="rustdesk"

WORKDIR="/etc/rustdesk"

start_service() {
if [ ! -d "$WORKDIR" ]; then
Copy link
Member

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.

Comment on lines +11 to +12
mkdir -p "$WORKDIR"
if [ $? -ne 0 ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"
Copy link
Member

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

Comment on lines +35 to +43
stop_service() {
killall hbbs
killall hbbr
}

reload_service() {
stop_service
start_service
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants