feature(delta): use WEBI_UA for curl.exe
[webi-installers/.git] / serviceman / README.md
index 57fff04d70476eb960c4302f8e343b42e5c5af86..e05096829e0640f695af20efd94b8582a80b01ec 100644 (file)
@@ -3,21 +3,35 @@ title: Serviceman
 homepage: https://git.rootprojects.org/root/serviceman
 tagline: |
   Serviceman: cross-platform service management for Linux, Mac, and Windows.
-description: |
-  Serviceman is a hassle-free wrapper around your system launcher. It works with the default system launcher to make it easy to start _user_- and _system_-level services, such as webservers, backup scripts, network and system tools, etc.
-
-  Supports
-    - `launchctl` (macOS)
-    - `systemctl` (Linux)
-    - The Registry (Windows)
 ---
 
+To update or switch versions, run `webi serviceman@stable`
+
+## Cheat Sheet
+
+> Serviceman is a hassle-free wrapper around your system launcher. It works with
+> the default system launcher to make it easy to start _user_- and
+> _system_-level services, such as webservers, backup scripts, network and
+> system tools, etc.
+
+Supports
+
+- `launchctl` (macOS)
+- `systemctl` (Linux)
+- The Registry (Windows)
+
 Serviceman can run an app in just about any programming language very simply.
 
 If you'd like to learn what `serviceman` does without actually making changes,
 add the `--dryrun` option.
 
-### Node.js
+### Example: Bash
+
+```bash
+sudo env PATH="$PATH" serviceman add bash ./backup.sh /mnt/data
+```
+
+### Example: Node.js
 
 **Development Server**
 
@@ -25,7 +39,8 @@ add the `--dryrun` option.
 pushd ./my-node-app/
 
 sudo env PATH="$PATH" \
-    serviceman add --system --cap-net-bind npx nodemon
+    serviceman add --system --cap-net-bind \
+    npx nodemon ./server.js
 ```
 
 **Production Server**
@@ -34,10 +49,11 @@ sudo env PATH="$PATH" \
 pushd ./my-node-app/
 
 sudo env PATH="$PATH" \
-    serviceman add --system --cap-net-bind npm start
+    serviceman add --system --cap-net-bind \
+    npm start
 ```
 
-### Golang
+### Example: Golang
 
 ```bash
 pushd ./my-go-package/
@@ -56,10 +72,27 @@ sudo env PATH="$PATH" \
     ./my-service --port 80
 ```
 
-### And even bash!
+### How to see all services
 
 ```bash
-sudo env PATH="$PATH" serviceman add bash ./backup.sh /mnt/data
+serviceman list --system
+serviceman list --user
+```
+
+```txt
+serviceman-managed services:
+
+        example-service
+```
+
+### How to restart a service
+
+You can either `add` the service again (which will update any changed options),
+or you can `stop` and then `start` any service by its name:
+
+```bash
+sudo env PATH="$PATH" serviceman stop example-service
+sudo env PATH="$PATH" serviceman start example-service
 ```
 
 ## What a typical systemd .service file looks like