Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions migrations/1783292001.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
echo "Remove stale 99-omarchy-nofile.conf systemd drop-ins"

# Earlier Omarchy shipped 99-omarchy-nofile.conf using the key
# 'DefaultLimitNOFILESoft', which is not a valid systemd manager setting.
# systemd rejects it at manager load on every boot:
# /etc/systemd/system.conf.d/99-omarchy-nofile.conf: Unknown key
# 'DefaultLimitNOFILESoft' in section [Manager], ignoring.
# It was replaced by 20-omarchy-nofile.conf (DefaultLimitNOFILE=soft:hard),
# but the orphaned 99- files are unowned by any package and linger on
# upgraded systems, spamming the journal on every boot. Remove them; the
# 20-omarchy-nofile.conf drop-in already sets the limit correctly.

as_root() {
if (( EUID == 0 )); then
"$@"
else
sudo "$@"
fi
}
Comment on lines +13 to +19

removed=0
for f in \
/etc/systemd/system.conf.d/99-omarchy-nofile.conf \
/etc/systemd/user.conf.d/99-omarchy-nofile.conf; do
if [[ -f $f ]]; then
as_root rm -f "$f" && removed=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Abort when privileged drop-in removal fails

If the privileged rm fails here (for example the user cancels sudo authentication, sudo is unavailable, or one of the two removals errors), Bash does not trigger errexit because the command is on the left side of &&; the script can then exit 0 with the stale file still present. Since bin/omarchy-migrate touches the migration marker immediately after a 0 exit, that user will not be prompted to retry this migration, so the boot-time systemd warning remains permanently until manually fixed.

Useful? React with 👍 / 👎.

fi
Comment on lines +25 to +27
done

if (( removed )); then
as_root systemctl daemon-reload >/dev/null 2>&1 || true
fi
Comment on lines +30 to +32