From e9408d4bfb20c7236b25ee351f330c4cd819e0b4 Mon Sep 17 00:00:00 2001
From: obarun <eric@obarun.org>
Date: Sat, 9 Dec 2023 10:49:06 +1100
Subject: [PATCH] add halt, poweroff and reboot docs

---
 doc/halt.md     | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/poweroff.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/reboot.md   | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 174 insertions(+)
 create mode 100644 doc/halt.md
 create mode 100644 doc/poweroff.md
 create mode 100644 doc/reboot.md

diff --git a/doc/halt.md b/doc/halt.md
new file mode 100644
index 00000000..944c9d81
--- /dev/null
+++ b/doc/halt.md
@@ -0,0 +1,58 @@
+title: The 66 Suite: halt
+author: Eric Vidal <eric@obarun.org>
+
+[66](index.html)
+
+[Software](https://web.obarun.org/software)
+
+[obarun.org](https://web.obarun.org)
+
+# halt
+
+This command triggers the halt procedure.
+
+## Interface
+
+```
+halt [ -h ] [ -a ] [ -f|F ] [ -m message ] [ -t time ] [ -W ] when
+```
+
+This command triggers the halt procedure immediately if *when* is omitted.
+
+The *when* provided **must be** on these formats:
+
+- *now*: triggers the halt sequence immediately. This is the default
+- *mins* or *+mins* : relative time; triggers the halt sequence after *mins* minutes.
+- *hh:mm* : absolute time; triggers the halt sequence when the time *hh:mm* occurs. If that time has passed for the current day, it will wait for the next day. *hh* can have 1 or 2 digits; *mm* **must have** 2 digits.
+
+## Options
+
+- **-h**: print this help.
+- **-a**: use access control. The halt sequence will only be launched if one of the users listed in `/etc/66/shutdown.allow` is currently logged in (as tracked by utmp). `/etc/66/shutdown.allow` is a text file which accepts one user per line. Lines starting with # are commented out.
+- **-f**: do not trigger a clean shutdown procedure; it will just sync the filesystems then tell the kernel to immediately halt. This should be the last step in the lifetime of the machine.
+- **-F**: same as `-f` but do not sync the filesystems.
+- **-m** *message*: replace the default message by message. message is broadcast to all logged in users (as tracked by utmp).
+- **-t** *time*: have a grace time period of *time* seconds between the `SIGTERM` and the `SIGKILL` at the end of the halt sequence when it is time to kill all processes (allows processes to receive `SIGTERM` to exit cleanly). The default is `3` seconds.
+- **-W**: do not send a wall message to users.
+
+## Usage examples
+
+Halts the system.
+```
+66 halt
+```
+
+Halts a broken system
+```
+66 halt -f
+```
+
+Halts the system after 10 minutes
+```
+66 halt 10
+```
+
+Sends an "system will be halted in 10 minutes" to connected account and halt the system after 10 minutes
+```
+66 halt -m "system will be halted in 10 minutes" 10
+```
diff --git a/doc/poweroff.md b/doc/poweroff.md
new file mode 100644
index 00000000..7d41d17c
--- /dev/null
+++ b/doc/poweroff.md
@@ -0,0 +1,58 @@
+title: The 66 Suite: poweroff
+author: Eric Vidal <eric@obarun.org>
+
+[66](index.html)
+
+[Software](https://web.obarun.org/software)
+
+[obarun.org](https://web.obarun.org)
+
+# poweroff
+
+This command triggers the poweroff procedure.
+
+## Interface
+
+```
+poweroff [ -h ] [ -a ] [ -f|F ] [ -m message ] [ -t time ] [ -W ] when
+```
+
+This command triggers the poweroff procedure immediately if *when* is omitted.
+
+The *when* provided **must be** on these formats:
+
+- *now*: triggers the poweroff sequence immediately. This is the default
+- *mins* or *+mins* : relative time; triggers the poweroff sequence after *mins* minutes.
+- *hh:mm* : absolute time; triggers the poweroff sequence when the time *hh:mm* occurs. If that time has passed for the current day, it will wait for the next day. *hh* can have 1 or 2 digits; *mm* **must have** 2 digits.
+
+## Options
+
+- **-h**: print this help.
+- **-a**: use access control. The poweroff sequence will only be launched if one of the users listed in `/etc/66/shutdown.allow` is currently logged in (as tracked by utmp). `/etc/66/shutdown.allow` is a text file which accepts one user per line. Lines starting with # are commented out.
+- **-f**: do not trigger a clean shutdown procedure; it will just sync the filesystems then tell the kernel to immediately poweroff. This should be the last step in the lifetime of the machine.
+- **-F**: same as `-f` but do not sync the filesystems.
+- **-m** *message*: replace the default message by message. message is broadcast to all logged in users (as tracked by utmp).
+- **-t** *time*: have a grace time period of *time* seconds between the `SIGTERM` and the `SIGKILL` at the end of the poweroff sequence when it is time to kill all processes (allows processes to receive `SIGTERM` to exit cleanly). The default is `3` seconds.
+- **-W**: do not send a wall message to users.
+
+## Usage examples
+
+Shuts down the system.
+```
+66 poweroff
+```
+
+Shuts down a broken system
+```
+66 poweroff -f
+```
+
+Shuts down the system after 10 minutes
+```
+66 poweroff 10
+```
+
+Sends an "system will be shutted down in 10 minutes" to connected account and shuts down the system after 10 minutes
+```
+66 poweroff -m "system will be shutted down in 10 minutes" 10
+```
diff --git a/doc/reboot.md b/doc/reboot.md
new file mode 100644
index 00000000..b505da95
--- /dev/null
+++ b/doc/reboot.md
@@ -0,0 +1,58 @@
+title: The 66 Suite: reboot
+author: Eric Vidal <eric@obarun.org>
+
+[66](index.html)
+
+[Software](https://web.obarun.org/software)
+
+[obarun.org](https://web.obarun.org)
+
+# reboot
+
+This command triggers the reboot procedure.
+
+## Interface
+
+```
+reboot [ -h ] [ -a ] [ -f|F ] [ -m message ] [ -t time ] [ -W ] when
+```
+
+This command triggers the reboot procedure immediately if *when* is omitted.
+
+The *when* provided **must be** on these formats:
+
+- *now*: triggers the reboot sequence immediately. This is the default
+- *mins* or *+mins* : relative time; triggers the reboot sequence after *mins* minutes.
+- *hh:mm* : absolute time; triggers the reboot sequence when the time *hh:mm* occurs. If that time has passed for the current day, it will wait for the next day. *hh* can have 1 or 2 digits; *mm* **must have** 2 digits.
+
+## Options
+
+- **-h**: print this help.
+- **-a**: use access control. The reboot sequence will only be launched if one of the users listed in `/etc/66/shutdown.allow` is currently logged in (as tracked by utmp). `/etc/66/shutdown.allow` is a text file which accepts one user per line. Lines starting with # are commented out.
+- **-f**: do not trigger a clean shutdown procedure; it will just sync the filesystems then tell the kernel to immediately reboot. This should be the last step in the lifetime of the machine.
+- **-F**: same as `-f` but do not sync the filesystems.
+- **-m** *message*: replace the default message by message. message is broadcast to all logged in users (as tracked by utmp).
+- **-t** *time*: have a grace time period of *time* seconds between the `SIGTERM` and the `SIGKILL` at the end of the reboot sequence when it is time to kill all processes (allows processes to receive `SIGTERM` to exit cleanly). The default is `3` seconds.
+- **-W**: do not send a wall message to users.
+
+## Usage examples
+
+reboots the system.
+```
+66 reboot
+```
+
+reboots a broken system
+```
+66 reboot -f
+```
+
+reboots the system after 10 minutes
+```
+66 reboot 10
+```
+
+Sends an "system will be rebooted in 10 minutes" to connected account and reboot the system after 10 minutes
+```
+66 reboot -m "system will be rebooted in 10 minutes" 10
+```
-- 
GitLab