mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-05-15 05:25:00 +00:00
fix(monitor): update beta service runtime path
This commit is contained in:
@@ -432,11 +432,8 @@ install_proxmenux_monitor() {
|
|||||||
if [ "$service_exists" = false ]; then
|
if [ "$service_exists" = false ]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
# Check if service needs to be updated (missing ExecStop or outdated config)
|
msg_info "Updating service configuration..."
|
||||||
if ! grep -q "ExecStop=" "$MONITOR_SERVICE_FILE" 2>/dev/null; then
|
update_monitor_service
|
||||||
msg_info "Updating service configuration (adding shutdown notification)..."
|
|
||||||
update_monitor_service
|
|
||||||
fi
|
|
||||||
|
|
||||||
systemctl start proxmenux-monitor.service
|
systemctl start proxmenux-monitor.service
|
||||||
sleep 2
|
sleep 2
|
||||||
@@ -465,7 +462,7 @@ Conflicts=shutdown.target reboot.target halt.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=$MONITOR_INSTALL_DIR
|
WorkingDirectory=$MONITOR_RUNTIME_DIR
|
||||||
ExecStart=$exec_path
|
ExecStart=$exec_path
|
||||||
ExecStop=/bin/bash $MONITOR_INSTALL_DIR/scripts/shutdown-notify.sh
|
ExecStop=/bin/bash $MONITOR_INSTALL_DIR/scripts/shutdown-notify.sh
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
@@ -488,7 +485,9 @@ create_monitor_service() {
|
|||||||
local exec_path="$MONITOR_RUNTIME_DIR/AppRun"
|
local exec_path="$MONITOR_RUNTIME_DIR/AppRun"
|
||||||
|
|
||||||
if [ -f "$TEMP_DIR/systemd/proxmenux-monitor.service" ]; then
|
if [ -f "$TEMP_DIR/systemd/proxmenux-monitor.service" ]; then
|
||||||
sed "s|ExecStart=.*|ExecStart=$exec_path|g" \
|
sed -e "s|^ExecStart=.*|ExecStart=$exec_path|g" \
|
||||||
|
-e "s|^WorkingDirectory=.*|WorkingDirectory=$MONITOR_RUNTIME_DIR|g" \
|
||||||
|
-e "s|^Environment=.*PORT=.*|Environment=\"PORT=$MONITOR_PORT\"|g" \
|
||||||
"$TEMP_DIR/systemd/proxmenux-monitor.service" > "$MONITOR_SERVICE_FILE"
|
"$TEMP_DIR/systemd/proxmenux-monitor.service" > "$MONITOR_SERVICE_FILE"
|
||||||
msg_ok "Service file loaded from repository."
|
msg_ok "Service file loaded from repository."
|
||||||
else
|
else
|
||||||
@@ -502,7 +501,7 @@ Conflicts=shutdown.target reboot.target halt.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=$MONITOR_INSTALL_DIR
|
WorkingDirectory=$MONITOR_RUNTIME_DIR
|
||||||
ExecStart=$exec_path
|
ExecStart=$exec_path
|
||||||
ExecStop=/bin/bash $MONITOR_INSTALL_DIR/scripts/shutdown-notify.sh
|
ExecStop=/bin/bash $MONITOR_INSTALL_DIR/scripts/shutdown-notify.sh
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|||||||
Reference in New Issue
Block a user