Skip to content

Commit 769c00f

Browse files
authored
fix bsd script (#119)
1 parent 1d5d7f9 commit 769c00f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

rebot-telegram/rebasing-xyz-rebot-bsd.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
name="rebot"
77
rcvar="${name}_enable"
88
pidfile="/home/rebot/rebasing-xyz-rebot.pid"
9-
log_file="/home/rebot/rebasing-xyz-rebot.log"
109

1110
# Load configuration variables
1211
load_rc_config "$name"
@@ -27,7 +26,7 @@ cmd="${JAVA_CMD} -jar \
2726
-Dxyz.rebasing.rebot.delete.messages.after=${REBOT_TELEGRAM_DELETE_MESSAGES_AFTER} \
2827
-Dxyz.rebasing.rebot.plugin.openweather.appid=${REBOT_TELEGRAM_OPENWEATHER_APPID} \
2928
-Dquarkus.log.category.\"xyz.rebasing\".level=${REBOT_TELEGRAM_LOG_LEVEL} \
30-
/home/rebot/quarkus-app/quarkus-run.jar > ${log_file}"
29+
/home/rebot/quarkus-app/quarkus-run.jar"
3130
# Load environment variables from config file
3231
start_precmd="rebot_prestart"
3332
rebot_prestart() {
@@ -58,11 +57,8 @@ rebot_start() {
5857
fi
5958

6059
echo "Starting rebot."
61-
6260
echo "Start Command: ${cmd}"
63-
64-
exec su - ${rebot_user} ${cmd} &
65-
pgrep -f /home/rebot/quarkus-app/quarkus-run.jar > ${pidfile}
61+
su -m "${rebot_user}" -c "sh -c '${cmd} & echo \$! > \"${pidfile}\"'"
6662
}
6763

6864
# Stop command
@@ -79,4 +75,3 @@ rebot_stop() {
7975
rc_debug="YES"
8076
run_rc_command "$@"
8177

82-

0 commit comments

Comments
 (0)