# The session bus starts the search provider when a search needs it, and it leaves after five
# idle minutes. One still running when the package is removed is stopped, so nothing of it
# outlives the package. Nothing in a chroot or a system that isn't booted, such as an install.

pre_remove() {
    systemd-detect-virt --chroot >/dev/null 2>&1 && return 0
    systemd-notify --booted 2>/dev/null || return 0
    pkill -f ' /usr/lib/bluerune/extensions/notes-search/bluerune-notes-search$' || true
}
