about summary refs log tree commit diff
path: root/users/tazjin/presentations/systemd-2016/demo
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/presentations/systemd-2016/demo')
-rw-r--r--users/tazjin/presentations/systemd-2016/demo/demo-error.service7
-rw-r--r--users/tazjin/presentations/systemd-2016/demo/demo-limits.slice7
-rw-r--r--users/tazjin/presentations/systemd-2016/demo/demo-notify@.service6
-rw-r--r--users/tazjin/presentations/systemd-2016/demo/demo-path.path6
-rw-r--r--users/tazjin/presentations/systemd-2016/demo/demo-stress.service6
-rw-r--r--users/tazjin/presentations/systemd-2016/demo/demo-timer.timer12
-rw-r--r--users/tazjin/presentations/systemd-2016/demo/demo.service6
-rw-r--r--users/tazjin/presentations/systemd-2016/demo/notes.md27
8 files changed, 77 insertions, 0 deletions
diff --git a/users/tazjin/presentations/systemd-2016/demo/demo-error.service b/users/tazjin/presentations/systemd-2016/demo/demo-error.service
new file mode 100644
index 000000000000..b2d4c9d34799
--- /dev/null
+++ b/users/tazjin/presentations/systemd-2016/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/users/tazjin/presentations/systemd-2016/demo/demo-limits.slice b/users/tazjin/presentations/systemd-2016/demo/demo-limits.slice
new file mode 100644
index 000000000000..998185d26177
--- /dev/null
+++ b/users/tazjin/presentations/systemd-2016/demo/demo-limits.slice
@@ -0,0 +1,7 @@
+[Unit]
+Description=Limited resources demo
+DefaultDependencies=no
+Before=slices.target
+
+[Slice]
+CPUQuota=10%
diff --git a/users/tazjin/presentations/systemd-2016/demo/demo-notify@.service b/users/tazjin/presentations/systemd-2016/demo/demo-notify@.service
new file mode 100644
index 000000000000..e25524b4e230
--- /dev/null
+++ b/users/tazjin/presentations/systemd-2016/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/users/tazjin/presentations/systemd-2016/demo/demo-path.path b/users/tazjin/presentations/systemd-2016/demo/demo-path.path
new file mode 100644
index 000000000000..87f1342da995
--- /dev/null
+++ b/users/tazjin/presentations/systemd-2016/demo/demo-path.path
@@ -0,0 +1,6 @@
+[Unit]
+Description=Demonstrate systemd path units
+
+[Path]
+DirectoryNotEmpty=/tmp/hackeriet
+Unit=demo.service
diff --git a/users/tazjin/presentations/systemd-2016/demo/demo-stress.service b/users/tazjin/presentations/systemd-2016/demo/demo-stress.service
new file mode 100644
index 000000000000..7e14f13e29d9
--- /dev/null
+++ b/users/tazjin/presentations/systemd-2016/demo/demo-stress.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Stress test CPU
+
+[Service]
+Slice=demo.slice
+ExecStart=/usr/bin/stress -c 5
diff --git a/users/tazjin/presentations/systemd-2016/demo/demo-timer.timer b/users/tazjin/presentations/systemd-2016/demo/demo-timer.timer
new file mode 100644
index 000000000000..34eccb98b02a
--- /dev/null
+++ b/users/tazjin/presentations/systemd-2016/demo/demo-timer.timer
@@ -0,0 +1,12 @@
+[Unit]
+Description=Demonstrate systemd timers
+
+[Timer]
+OnActiveSec=2
+OnUnitActiveSec=5
+AccuracySec=5
+Unit=demo.service
+# OnCalendar=Thu,Fri 2016-*-1,5 11:12:13
+
+[Install]
+WantedBy=multi-user.target
diff --git a/users/tazjin/presentations/systemd-2016/demo/demo.service b/users/tazjin/presentations/systemd-2016/demo/demo.service
new file mode 100644
index 000000000000..fcc710ad933f
--- /dev/null
+++ b/users/tazjin/presentations/systemd-2016/demo/demo.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Demo unit for systemd
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/echo "Systemd unit activated. Hello Hackeriet."
diff --git a/users/tazjin/presentations/systemd-2016/demo/notes.md b/users/tazjin/presentations/systemd-2016/demo/notes.md
new file mode 100644
index 000000000000..b4866b1642bb
--- /dev/null
+++ b/users/tazjin/presentations/systemd-2016/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