Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Does systemd-inhibit show an explanation what was inhibited, like in my script? My file is in a pen drive. I can also check if the pen drive is plugged in (not just mounted)? Commented Oct 29, 2024 at 12:40
  • where would you show that, even? That makes no sense; your script could only show that message on the console it's being run from, and people don't leave a console open to watch for such messages. But yes, some desktop environments will inform you that, and some even which, a program has inhibited shutdown. Commented Oct 29, 2024 at 13:39
  • I like to see the booting messages, so I have disabled the graphic boot. So, I always do Ctrl-Alt-Del in the virtual console, after logging out from KDE. Commented Oct 29, 2024 at 14:29
  • well, OK, that still wouldn't make much sense; your script would have to have access to the current console. Anyways, yeah, again, your script approach doesn't work, you'll have to do something different – which is why I wrote this answer. If you want, you can always write to whatever thing you want to write to make a message shown in your inhibitor as described above. That's up to you. Commented Oct 29, 2024 at 14:30
  • echo "..." > /dev/console works perfectly for me. Commented Oct 29, 2024 at 14:32