Skip to content

Commit

Permalink
Fix and update init script after ChirpStack rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
brocaar committed Nov 5, 2019
1 parent e4712da commit fb701a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packaging/files/chirpstack-gateway-bridge.init
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function do_start {
}

function do_stop {
start-stop-daemon --stop --retry=TERM/30/KILL/5 --pidfile "$PID_FILE" --name "$NAME"
start-stop-daemon --stop --retry=TERM/30/KILL/5 --pidfile "$PID_FILE" --exec "$DAEMON"
retval="$?"
sleep 1
return "$retval"
Expand Down
10 changes: 8 additions & 2 deletions packaging/scripts/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@ function restart_service {
fi
}

function create_logdir {
if [[ ! -d $LOG_DIR ]]; then
mkdir -p $LOG_DIR
chown -R $DAEMON_USER:$DAEMON_GROUP $LOG_DIR
fi
}

# create user
id $DAEMON_USER &>/dev/null
if [[ $? -ne 0 ]]; then
useradd --system -U -M $DAEMON_USER -s /bin/false -d /etc/$NAME
fi

mkdir -p "$LOG_DIR"
chown $DAEMON_USER:$DAEMON_GROUP "$LOG_DIR"
create_logdir

# set the configuration owner / permissions
if [[ -f /etc/$NAME/$NAME.toml ]]; then
Expand Down

0 comments on commit fb701a7

Please sign in to comment.