Ubuntu 18.04 and 20.04
Hi,
I have a backup script running as a systemd service (borgmatic) with the use of systemd-inhibit
to block the user to reboot/sleep/shutdown the computer. This works well.
Unfortunatelly, when the user tries to shutdown or reboot the computer in GNOME and nothing happens - i.e. the action silently fails - then the user is confused and eventually turns off the computer by long-press of the power button :-(
What I would like to achieve is to be able to open a dialog window (with zenity or notify-send) and tell the user to wait a bit - but only after he tries to shutdown.
I have experimented a bit with systemd --user
service units to have zenity dialog displayed before various targets (gnome-session-shutdown.target
), but that does not work as the shutdown procedure does not even starts... (And even if it started, the Xorg seems to be down already and zenity fails due to missing DISPLAY.)
When systemd-inhibit
is active, then this is logged upon user trying to shutdown:
dec 26 21:41:18 t410s gnome-shell[8333]: endSessionDialog: No XDG_SESSION_ID, fetched from logind: 17
dec 26 21:41:19 t410s gnome-shell[8333]: endSessionDialog: No XDG_SESSION_ID, fetched from logind: 17
dec 26 21:41:22 t410s gnome-session[8314]: gnome-session-binary[8314]: WARNING: Shutdown failed: GDBus.Error:System.Error.ESTALE: Stale file handle
dec 26 21:41:22 t410s gnome-session-binary[8314]: WARNING: Shutdown failed: GDBus.Error:System.Error.ESTALE: Stale file handle
dec 26 21:41:22 t410s gnome-session-binary[8314]: Entering running state
dec 26 21:41:22 t410s gnome-shell[8333]: Ignored exception from dbus method: Gio.IOErrorEnum: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19:
Any idea how to display a message that backup is running?
EDIT: As @matigo suggested, I have implemented a work-around to display a different wallpaper while backup is in progress, and hope for the best...