Actions
Bug #22391
openStandardize systemd service handling
Status:
New
Priority:
Normal
Assigned To:
-
Category:
Deployment
Target version:
-
Story points:
-
Description
At the bottom of source:build/go-python-package-scripts/postinst.sh, we automatically enable and start any included service. This is not great for a couple of reasons:
- If an administrator previously disabled a service, any package upgrade will re-enable it. (They can work around this by masking the unit, but it's still rude.)
- RPM packages are never supposed to do this by policy, so it's surprising behavior for those administrators.
IMO our packages should never automatically enable a service, and instead we should leave that job to a Salt/Ansible installer, which has more information about what the state of the system is expected to be than a postinst script ever can. If we install service definitions directly to /lib/systemd/system
from our fpm build, then the main body of our generic postinst can be as simple as:
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
systemctl try-restart SERVICE
fi
Actions