{"id":18974503,"url":"https://github.com/m7a/lp-mahalt","last_synced_at":"2025-08-24T19:06:56.420Z","repository":{"id":164554623,"uuid":"296972438","full_name":"m7a/lp-mahalt","owner":"m7a","description":"MDVL System Shutdown Command","archived":false,"fork":false,"pushed_at":"2024-04-28T19:55:06.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-01T09:08:00.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m7a.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-20T00:10:13.000Z","updated_at":"2024-04-28T19:55:10.000Z","dependencies_parsed_at":"2024-04-28T20:50:42.832Z","dependency_job_id":null,"html_url":"https://github.com/m7a/lp-mahalt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Flp-mahalt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Flp-mahalt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Flp-mahalt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Flp-mahalt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m7a","download_url":"https://codeload.github.com/m7a/lp-mahalt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239972035,"owners_count":19727290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T15:15:14.702Z","updated_at":"2025-02-21T07:23:13.556Z","avatar_url":"https://github.com/m7a.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\nsection: 11\nx-masysma-name: mahalt\ntitle: System Shutdown Script\ndate: 2020/09/20 01:30:30\nlang: en-US\nauthor: [\"Linux-Fan, Ma_Sys.ma (Ma_Sys.ma@web.de)\"]\nkeywords: [\"script\", \"mdvl\", \"mahalt\", \"sudo\"]\nx-masysma-version: 1.0.0\nx-masysma-repository: https://www.github.com/m7a/lp-mahalt\nx-masysma-website: https://masysma.net/11/mahalt.xhtml\nx-masysma-owned: 1\nx-masysma-copyright: |\n  Copyright (c) 2012, 2017, 2020 Ma_Sys.ma.\n  For further info send an e-mail to Ma_Sys.ma@web.de.\n---\nName\n====\n\n`mahalt` -- Shutdown system after invoking scripts.\n\nSynposis\n========\n\n\tmahalt [-f] [-r]\n\nDescription\n===========\n\nThis script is intended to serve as a means of shutting down desktop systems.\n\nThe following features are added compared to a direct invocation of\n`systemctl poweroff` (or similar):\n\n * Regular users should be able to invoke shutdown. By including\n   sudo configuration and a means to automatically restart the script with sudo,\n   it becomes possible for users to conveniently invoke the script.\n * To perform backups and other tasks that are best run individually without\n   other services interfering, directory `/usr/lib/mahalt.d` is consulted for\n   executable files. They are executed in the order reported by `find | sort`.\n * Before invoking the actual shutdown command, all Java applications are sent\n   a `SIGTERM` and `sync` is called.\n * If immediately before invoking the actual shutdown, `/tmp/nohalt` exists,\n   the process is cancelled. This feature can be used by the scripts in\n   `/usr/lib/mahalt.d` or by users on the local machine who wish to interrupt\n   the shutdown process without cancelling any of the running hooks from\n   `/usr/lib/mahalt.d`.\n\n## Notes on hooks\n\n * All executables form `/usr/lib/mahalt.d` are passed parameter `--by-mahalt`.\n * Outputs from hooks are written to file `/var/log/mahalt` and can thus be\n   analyzed after the next reboot.\n\n## WARNING: Sudo Configuration Included\n\nThis package includes a sudoers configuration allowing user `linux-fan` to\nrun the `mahalt` command which makes a `shutdown`-style command available to a\nuser. Beware that this is not expected to be a safe operation on servers as\nregular users may not have physical access.\n\nOptions\n=======\n\n----  --------------------------------------------------------\n`-f`  Fast -- skip execution of hooks from `/usr/lib/mahalt.d`\n`-r`  Reboot instead of shutdown\n----  --------------------------------------------------------\n\nRationale\n=========\n\nSimilar to [vifm-ext(32)](../32/vifm-ext.xhtml), this script could have been\nwritten in a manner that would have avoided the use of sudo/full-blown root\nprivileges for shutdown. Modern desktop environments use `dbus`-based calls\nto invoke shutdown and the regular `systemctl poweroff` nowdays often works for\nunprivileged users if systemd detects that they are the only ones logged in to\nthe local system.\n\nThis route was not taken for the following reasons:\n\n * Similar to mounting, the interface for “shutdown without root” often broke\n   between release upgrades.\n * Ma_Sys.ma Backups run as root as to avoid the problem of files being\n   inaccessible due to missing permissions. Hence, that part would need to\n   run with sudo anyways.\n\nBugs\n====\n\n * File names from below `/usr/lib/mahalt.d` may not contain spaces.\n * The `killall -s TERM java` invocation may stop some processes that should\n   better be managed by their respective “supervisors” like systemd or docker...\n\nSee Also\n========\n\n[halt(8)](https://manpages.debian.org/buster/sysvinit-core/halt.8.en.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7a%2Flp-mahalt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm7a%2Flp-mahalt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7a%2Flp-mahalt/lists"}