about summary refs log tree commit diff
path: root/demo
diff options
context:
space:
mode:
authorVincent Ambo <vincent@kivra.com>2016-01-21T15·21+0100
committerVincent Ambo <vincent@kivra.com>2016-01-21T15·21+0100
commitd2e97f40421d3f886429ab612d5de178700c40b0 (patch)
treea37b2985706b45cd76d9fff4b142f5c5e2bfaa54 /demo
parentf368f12a90d66f971b97d08f8702204b67111a51 (diff)
Add some demo units
Diffstat (limited to 'demo')
-rw-r--r--demo/demo-error@.service7
-rw-r--r--demo/demo-limits.slice8
-rw-r--r--demo/demo-notify@.service6
-rw-r--r--demo/demo-timer.service6
-rw-r--r--demo/demo-timer.timer12
-rw-r--r--demo/notes.md27
6 files changed, 66 insertions, 0 deletions
diff --git a/demo/demo-error@.service b/demo/demo-error@.service
new file mode 100644
index 000000000000..b2d4c9d34799
--- /dev/null
+++ b/demo/demo-error@.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Demonstrate failing units
+OnFailure=demo-notify@%n.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/false
diff --git a/demo/demo-limits.slice b/demo/demo-limits.slice
new file mode 100644
index 000000000000..583db59badcd
--- /dev/null
+++ b/demo/demo-limits.slice
@@ -0,0 +1,8 @@
+[Unit]
+Description=Limited resources demo
+DefaultDependencies=no
+Before=slices.target
+
+[Slice]
+CPUQuota=10%
+MemoryLimit=1G
diff --git a/demo/demo-notify@.service b/demo/demo-notify@.service
new file mode 100644
index 000000000000..e25524b4e230
--- /dev/null
+++ b/demo/demo-notify@.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Demonstrate systemd templating by sending a notification
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/notify-send 'Systemd notification' '%i'
diff --git a/demo/demo-timer.service b/demo/demo-timer.service
new file mode 100644
index 000000000000..2f6a20e14754
--- /dev/null
+++ b/demo/demo-timer.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Demo unit for systemd timers
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/echo "Systemd timer fired! Hello Hackeriet."
diff --git a/demo/demo-timer.timer b/demo/demo-timer.timer
new file mode 100644
index 000000000000..ab5ec5135ab4
--- /dev/null
+++ b/demo/demo-timer.timer
@@ -0,0 +1,12 @@
+[Unit]
+Description=Demonstrate systemd timers
+
+[Timer]
+OnActiveSec=2
+OnUnitActiveSec=5
+AccuracySec=5
+
+# OnCalendar=Thu,Fri 2016-*-1,5 11:12:13
+
+[Install]
+WantedBy=multi-user.target
diff --git a/demo/notes.md b/demo/notes.md
new file mode 100644
index 000000000000..b4866b1642bb
--- /dev/null
+++ b/demo/notes.md
@@ -0,0 +1,27 @@
+# simple oneshot
+
+Run `demo-notify@hello.service`
+
+# simple timer
+
+Run `demo-timer.timer`, show both
+
+# enabling
+
+Enable `demo-timer.timer`, go to symlink folder, disable
+
+# OnError
+
+Show & run `demo-error.service`
+
+# cgroups demo
+
+Start `demo-stress.service` without, show in htop, stop
+Show slice unit, start slice unit
+Add Slice=demo-limits.slice
+daemon-reload
+Start stress again
+
+# Proper service
+
+Look at nginx unit