SSSSShutdown
Safe Muscle Memory for Linux Sysadmins

Never Accidentally Power Off Remote Servers Again

SSShutdown abstracts system shutdown, rebooting, package updates, and CPU frequency management behind intentional, distinctive commands so you never accidentally shut down a production host.

Advertisement

The Philosophy

Building safe habits through muscle memory reconditioning.

Typing poweroff, shutdown -h now, or reboot into a terminal comes naturally when wrapping up your workday on your local workstation. But if an SSH session to an offsite production cluster is still active in another tmux pane or window, that same muscle memory can bring down critical infrastructure.

The Fail-Safe Mechanism: By exclusively training your fingers to use distinctive commands like SSShutdown, RRReboot, and UUUpdateAndShutdown, running them by mistake on a remote server safely triggers an innocuous command not found error.

Command Reference

Every command is streamlined for speed, safety, and operational awareness.

Power & System State

SSShutdown

Unceremoniously powers off the local machine via sudo poweroff.

RRReboot

Unceremoniously reboots the machine via sudo reboot.

sssuspend

Suspends the system to RAM using systemctl suspend.

hhhibernate

Verifies active swap before safely executing systemctl hibernate.

hybrid

Performs hybrid sleep state via systemctl hybrid-sleep.

Package Management & Updates

CommandCeremony?Description
UpdateOnlyYesChecks if updated in the past 24 hours. If older, updates all packages.
UUUpdateAndShutdownYesRuns ceremonial package updates; powers off only if updates succeed.
MorningUpdateNo (Forces)Clears update timestamps and forces a full system upgrade.
FFForceUpdateAndShutdownNo (Forces)Forces immediate upgrade and powers down on completion.
mmmirrorUpdaterReflectorRefreshes, tests, and sorts fastest regional package mirrors.
CleanRingRecoveryUniversal GPG keyring repair for Arch, Debian/Ubuntu, and Red Hat/Fedora.
ArchLinuxCleanRingAliasBackward-compatible alias pointing to CleanRing.

CPU & Energy Governors

Performance

Sets CPU governor to performance and clocks all cores to maximum rated frequency.

PowerSave

Locks CPUs to minimum frequency and automatically triggers powertop --auto-tune.

Mid

Limits CPU clocks to 50% max frequency under powersave governor to reduce fan noise.

Low

Caps CPU clocks to 25% max frequency for extreme battery preservation.

The Ceremony

Intelligent caching prevents wasteful daily bandwidth consumption.

Running full repository syncs multiple times a day strains package mirrors and wastes bandwidth. SSShutdown introduces Ceremony: checking marker files in /root/.updated and /var/cache/pacman/ using POSIX timestamp differentials.

# Default interval checks: SYSTEM_UPDATE_INTERVAL=1 # days before repeating system upgrade MIRROR_UPDATE_INTERVAL=7 # days before re-ranking mirrors SYSTEM_CLEARCACHE_INTERVAL=30 # days before purging stale package caches

If the system was already upgraded within the threshold interval, SSShutdown gracefully skips the redundant operation and proceeds immediately.

Multi-Distribution Support

Detects system metadata from /etc/os-release and routes to the native package manager.

Arch & Omarchy

Native pacman, reflector, powerpill, and paccache automated cleaning.

Debian & Ubuntu

Non-interactive apt-get with dpkg lock checking, automated autoremove, and reboot alerts.

Red Hat & Fedora

Robust dnf/yum/microdnf upgrades, lock checks, RPM key recovery, and needs-restarting.

openSUSE

Reliable zypper -n update operations with ceremony caching.

NixOS

Native integration with Nix auto updates (nx auto -f).

Lifecycle Hooks

Universal pre/post execution hooks via /etc/ssshutdown/hooks/in and out across all distros.

Advertisement

Installation

Get up and running in seconds on any Linux distribution.

Automated One-Liner

curl -sL https://raw.githubusercontent.com/joshuacox/SSShutdown/master/bootstrap | bash

Traditional Makefile

git clone https://github.com/joshuacox/SSShutdown.git cd SSShutdown sudo make install

Custom Target Prefix

PREFIX=/opt make -e install

Nix Flake

nix profile install github:joshuacox/SSShutdown

Environment Variables

Configure behavior dynamically without modifying files.

VariableDefaultPurpose
REFLECTOR_COUNTRYUSCountry code passed to reflector for mirror filtering on Arch.
APT_UPGRADE_TYPEupgradeDebian upgrade mode (upgrade or dist-upgrade).
REDHAT_PKG_MGRAutoOverride package manager on Red Hat systems (dnf, yum, microdnf).
SYSTEM_UPDATE_INTERVAL1Number of days before performing a ceremony update.
MIRROR_UPDATE_INTERVAL7Days between mirror ranking cycles.
SYSTEM_CLEARCACHE_INTERVAL30Days between running cache cleanup (paccache, apt autoremove, dnf clean).
PACMAN_LOOPERtrueRetries update loop up to 10 times if keyrings require refresh.
USE_POWERPILLfalseAccelerates downloads using parallel segmented powerpill.
DEBUGfalseEnables set -x debugging output across all scripts.
Advertisement