From d1844fc814bb9be22e801ba9292f789cb60cdc3a Mon Sep 17 00:00:00 2001
From: Banjo Fox <4459812+BanjoFox@users.noreply.github.com>
Date: Sun, 21 Feb 2021 14:04:20 -0500
Subject: [PATCH] Banjo/owncast systemd service (#749)
* Adding systemd service files to ..\examples
* Update owncast-systemd-service.md
* Update owncast-systemd-service.md
* Update owncast-systemd-service.md
* Update owncast-systemd-service.md
* correct slash syntax
* Update owncast-sample.service with generic paths
* Adding instructions to owncast-systemd-service.md
---
examples/owncast-sample.service | 13 +++++++++
examples/owncast-systemd-service.md | 41 +++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
create mode 100644 examples/owncast-sample.service
create mode 100644 examples/owncast-systemd-service.md
diff --git a/examples/owncast-sample.service b/examples/owncast-sample.service
new file mode 100644
index 000000000..e843fb063
--- /dev/null
+++ b/examples/owncast-sample.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Owncast Service
+
+[Service]
+Type=simple
+WorkingDirectory=[path_to_owncast_root_directory]
+ExecStart=[path_to_owncast_executable]
+Restart=on-failure
+RestartSec=5
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/examples/owncast-systemd-service.md b/examples/owncast-systemd-service.md
new file mode 100644
index 000000000..9a9df464f
--- /dev/null
+++ b/examples/owncast-systemd-service.md
@@ -0,0 +1,41 @@
+This can be any text that makes sense to you.
+```
+[Unit]
+Description=Owncast Service
+```
+
+This is where the "functional" parts of the service live.
+```
+[Service]
+Type=simple
+WorkingDirectory=[path_to_owncast_root_directory]
+ExecStart=[path_to_owncast_executable]
+Restart=on-failure
+RestartSec=5
+```
+`WorkingDirectory` should be where you want the owncast folder to live.
+
+**Example:**
+```WorkingDirectory=/var/www/owncast```
+
+Similarly the `ExecStart` is the actual owncast binary.
+
+**Example:**
+```ExecStart=/var/www/owncast/owncast```
+
+```
+[Install]
+WantedBy=multi-user.target
+```
+This just means, use runlevel 3 non-graphical.
+
+
+**INSTALLATION**
+Just create the file in your systemd configuraiton directory (typically /etc/systemd/system/), and update the systemd daemon with:
+```$sudo systemd daemon-reload```
+
+**USAGE**
+Currently the following options work
+- Start
+- Stop
+- Status