diff options
author | Vincent Ambo <vincent@kivra.com> | 2016-01-21T15·21+0100 |
---|---|---|
committer | Vincent Ambo <vincent@kivra.com> | 2016-01-21T15·21+0100 |
commit | d2e97f40421d3f886429ab612d5de178700c40b0 (patch) | |
tree | a37b2985706b45cd76d9fff4b142f5c5e2bfaa54 | |
parent | f368f12a90d66f971b97d08f8702204b67111a51 (diff) |
Add some demo units
-rw-r--r-- | demo/demo-error@.service | 7 | ||||
-rw-r--r-- | demo/demo-limits.slice | 8 | ||||
-rw-r--r-- | demo/demo-notify@.service | 6 | ||||
-rw-r--r-- | demo/demo-timer.service | 6 | ||||
-rw-r--r-- | demo/demo-timer.timer | 12 | ||||
-rw-r--r-- | demo/notes.md | 27 |
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 |