System Shutdown Script


mahalt – Shutdown system after invoking scripts.


mahalt [-f] [-r]


This script is intended to serve as a means of shutting down desktop systems.

The following features are added compared to a direct invocation of systemctl poweroff (or similar):

Notes on hooks

WARNING: Sudo Configuration Included

This package includes a sudoers configuration allowing user linux-fan to run the mahalt command which makes a shutdown-style command available to a user. Beware that this is not expected to be a safe operation on servers as regular users may not have physical access.


-f Fast – skip execution of hooks from /usr/lib/mahalt.d
-r Reboot instead of shutdown


Similar to vifm-ext(32), this script could have been written in a manner that would have avoided the use of sudo/full-blown root privileges for shutdown. Modern desktop environments use dbus-based calls to invoke shutdown and the regular systemctl poweroff nowdays often works for unprivileged users if systemd detects that they are the only ones logged in to the local system.

This route was not taken for the following reasons:


See Also

halt(8) Website 5 (1.0.2) – no Flash, no JavaScript, no Webfont, no Copy Protection, no Mobile First. No bullshit. No GUI needed. Works with any browser.

Created: 2020/09/20 01:30:30 | Revised: 2022/09/18 21:18:19 | Tags: script, mdvl, mahalt, sudo | Version: 1.0.0 | SRC (Pandoc MD) | GPL

Copyright (c) 2012, 2017, 2020 For further info send an e-mail to

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <>.