Wednesday, May 8, 2024
 Popular · Latest · Hot · Upcoming
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 14265  / 2 Years ago, fri, january 21, 2022, 9:51:40

How can I issue apt upgrades without automatically stopping/starting daemons? I'd like to manually restart services.



To cite a specific example:



I'll revisit a long-running machine and run sudo apt-get update && time sudo apt-get dist-upgrade. This is a very straight-forward means of seeing all available upgrades, followed by a simple Enter keypress to get the systems fully patched.



If I see postgresql-9.1 in the upgrade list, I abort the upgrade. In that case, apt would stop the service early in the process, apply several non-critical operations, then restart the service much later. A routine upgrade could cause minutes of downtime.



I'd like to say "yes" to the upgrade to get all patches applied, then manually restart the service at a convenient time.


More From » upgrade

 Answers
2

You can prevent service restarts with the Debian policy layer which works on Ubuntu as well.



Example:
Create a file named /usr/sbin/policy-rc.d with following content (don't forget to make the file executable):



#!/bin/sh

exit 101


No service¹ would be automatically started/stopped/restarted anymore.
See /usr/share/doc/sysv-rc/README.policy-rc.d.gz for details and how to adjust it to just ignore a single service.



1. as long as the installation scripts follow the Debian guidelines and use invoke-rc.d for service restarts


[#33827] Friday, January 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ditery

Total Points: 9
Total Questions: 116
Total Answers: 119

Location: Grenada
Member since Sun, Dec 20, 2020
3 Years ago
ditery questions
;