about summary refs log tree commit diff
path: root/presentations/systemd-2016/demo
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-21T00·26+0000
committerVincent Ambo <tazjin@google.com>2019-12-21T00·26+0000
commit8db37e39599943c33dab76e7cb390b0988e03839 (patch)
tree7c74b1130ae0600487c73b26652218d1733d987b /presentations/systemd-2016/demo
parent91d7f0300021247552e628b94bce2720bcd6d93e (diff)
chore(systemd-presentation): Prepare for depot merge
Diffstat (limited to 'presentations/systemd-2016/demo')
-rw-r--r--presentations/systemd-2016/demo/demo-error.service7
-rw-r--r--presentations/systemd-2016/demo/demo-limits.slice7
-rw-r--r--presentations/systemd-2016/demo/demo-notify@.service6
-rw-r--r--presentations/systemd-2016/demo/demo-path.path6
-rw-r--r--presentations/systemd-2016/demo/demo-stress.service6
-rw-r--r--presentations/systemd-2016/demo/demo-timer.timer12
-rw-r--r--presentations/systemd-2016/demo/demo.service6
-rw-r--r--presentations/systemd-2016/demo/notes.md27
8 files changed, 77 insertions, 0 deletions
diff --git a/presentations/systemd-2016/demo/demo-error.service b/presentations/systemd-2016/demo/demo-error.service
new file mode 100644
index 0000000000..b2d4c9d347
--- /dev/null
+++ b/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/presentations/systemd-2016/demo/demo-limits.slice b/presentations/systemd-2016/demo/demo-limits.slice
new file mode 100644
index 0000000000..998185d261
--- /dev/null
+++ b/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/presentations/systemd-2016/demo/demo-notify@.service b/presentations/systemd-2016/demo/demo-notify@.service
new file mode 100644
index 0000000000..e25524b4e2
--- /dev/null
+++ b/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/presentations/systemd-2016/demo/demo-path.path b/presentations/systemd-2016/demo/demo-path.path
new file mode 100644
index 0000000000..87f1342da9
--- /dev/null
+++ b/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/presentations/systemd-2016/demo/demo-stress.service b/presentations/systemd-2016/demo/demo-stress.service
new file mode 100644
index 0000000000..7e14f13e29
--- /dev/null
+++ b/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/presentations/systemd-2016/demo/demo-timer.timer b/presentations/systemd-2016/demo/demo-timer.timer
new file mode 100644
index 0000000000..34eccb98b0
--- /dev/null
+++ b/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/presentations/systemd-2016/demo/demo.service b/presentations/systemd-2016/demo/demo.service
new file mode 100644
index 0000000000..fcc710ad93
--- /dev/null
+++ b/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/presentations/systemd-2016/demo/notes.md b/presentations/systemd-2016/demo/notes.md
new file mode 100644
index 0000000000..b4866b1642
--- /dev/null
+++ b/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