fix: stop nixpanel service before overwriting binary to avoid text file busy error on reinstall
This commit is contained in:
+2
-1
@@ -252,8 +252,9 @@ if ! step_done "build_panel"; then
|
|||||||
apt-get install -y -qq upx-ucl 2>/dev/null || true
|
apt-get install -y -qq upx-ucl 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Main API binary
|
# Main API binary — stop service first so the file isn't busy
|
||||||
if [[ -f "target/release/nixpanel" ]]; then
|
if [[ -f "target/release/nixpanel" ]]; then
|
||||||
|
systemctl stop nixpanel 2>/dev/null || true
|
||||||
cp target/release/nixpanel "$BIN_DIR/nixpanel"
|
cp target/release/nixpanel "$BIN_DIR/nixpanel"
|
||||||
chmod 755 "$BIN_DIR/nixpanel"
|
chmod 755 "$BIN_DIR/nixpanel"
|
||||||
command -v upx &>/dev/null && upx --best --quiet "$BIN_DIR/nixpanel" 2>/dev/null || true
|
command -v upx &>/dev/null && upx --best --quiet "$BIN_DIR/nixpanel" 2>/dev/null || true
|
||||||
|
|||||||
Reference in New Issue
Block a user