From: Valters Jansons <valter.jansons@gmail.com>
To: location@lists.ipfire.org
Subject: [PATCH] cron: Quietly abort if the package was removed
Date: Tue, 27 Oct 2026 05:01:21 +0900 [thread overview]
Message-ID: <20261026200122.551196-1-valter.jansons@gmail.com> (raw)
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
reply other threads:[~2026-10-26 20:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261026200122.551196-1-valter.jansons@gmail.com \
--to=valter.jansons@gmail.com \
--cc=location@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox