Private
Public Access
1
0
Files
linux_patch_api/debian/postrm
Echo 77e8ac2e65
All checks were successful
CI/CD Pipeline / Code Format (push) Successful in 1s
CI/CD Pipeline / Clippy Lints (push) Successful in 46s
CI/CD Pipeline / Unit Tests (push) Successful in 58s
CI/CD Pipeline / Security Audit (push) Successful in 4s
CI/CD Pipeline / Build Arch Package (push) Successful in 1m55s
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Successful in 1m59s
CI/CD Pipeline / Build Alpine Package (push) Successful in 3m17s
CI/CD Pipeline / Build RPM Package (push) Successful in 3m42s
CI/CD Pipeline / Build Debian Package (push) Successful in 2m2s
fix: remove linux-patch-api user from dpkg scripts, change ownership to root
- Remove user/group creation from preinst (service runs as root)
- Change directory ownership to root:root in preinst and postinst
- Remove user/group deletion from postrm
- Service runs as root, no dedicated user needed
2026-05-03 02:29:06 +00:00

53 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# postrm script for linux-patch-api
# Created by package build system
set -e
# Handle purge - remove all configuration and data
if [ "$1" = "purge" ]; then
echo "Purging linux-patch-api configuration and data..."
# Stop service if still running
if systemctl is-active --quiet linux-patch-api.service 2>/dev/null; then
systemctl stop linux-patch-api.service
fi
# Disable service
if systemctl is-enabled --quiet linux-patch-api.service 2>/dev/null; then
systemctl disable linux-patch-api.service
fi
# Reload systemd to remove service file
systemctl daemon-reload
# Remove configuration directory (preserved by conffiles during normal remove)
if [ -d "/etc/linux_patch_api" ]; then
echo "Removing /etc/linux_patch_api..."
rm -rf /etc/linux_patch_api
fi
# Remove data directory
if [ -d "/var/lib/linux_patch_api" ]; then
echo "Removing /var/lib/linux_patch_api..."
rm -rf /var/lib/linux_patch_api
fi
# Remove log directory
if [ -d "/var/log/linux_patch_api" ]; then
echo "Removing /var/log/linux_patch_api..."
rm -rf /var/log/linux_patch_api
fi
echo "linux-patch-api purged successfully"
fi
# Handle upgrade/remove - just ensure service is disabled
if [ "$1" = "remove" ] || [ "$1" = "upgrade" ]; then
# Service should already be stopped by prerm
# Just reload systemd to remove the service file
systemctl daemon-reload 2>/dev/null || true
fi
exit 0