System Shutdown Script

Name

mahalt – Shutdown system after invoking scripts.

Synposis

mahalt [-f] [-r]

Description

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.

Options

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

Rationale

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:

Bugs

See Also

halt(8)


Ma_Sys.ma 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 Ma_Sys.ma. For further info send an e-mail to Ma_Sys.ma@web.de.

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 <http://www.gnu.org/licenses/>.