public inbox for location@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH] cron: Quietly abort if the package was removed
@ 2026-10-26 20:01 Valters Jansons
  0 siblings, 0 replies; only message in thread
From: Valters Jansons @ 2026-10-26 20:01 UTC (permalink / raw)
  To: location

Previously, Debian was not installing the cron job. Now packaging it up
and alerts about the risk of `/usr/bin/location` not being available.

The scenario for this is that `/etc` contains configuration files, so
running `apt remove location` would leave the cron job hanging. If it is
a standard system with systemd, then the cron job expects systemd to
manage everything. However, if the system doesn't have systemd, then the
cron job will try to run a non-existant binary every day. This should be
gracefully handled.
---
 src/cron/location-update.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/cron/location-update.in b/src/cron/location-update.in
index 6b1ebdc..8b7d23e 100644
--- a/src/cron/location-update.in
+++ b/src/cron/location-update.in
@@ -22,5 +22,10 @@ if [ -d /run/systemd/system ]; then
 	exit 0
 fi
 
+# Quietly abort if the package has been removed but not purged
+if [ ! -x @bindir@/location ]; then
+	exit 0
+fi
+
 # Call the location database updater
 exec @bindir@/location update
-- 
2.56.0



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-26 20:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 20:01 [PATCH] cron: Quietly abort if the package was removed Valters Jansons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox