aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2015-03-20 03:35:53 +0100
committerDavid Runge <dave@sleepmap.de>2015-03-20 03:35:53 +0100
commite81ad1c5c49ce00110daa6c651445064b30d5749 (patch)
treea12b4554b0fa92e45957a9d2b4cdd7f28b6b8e12
parentaeee1ec852141ebd07d304f817fb88886b1ab2f6 (diff)
downloaduenv-e81ad1c5c49ce00110daa6c651445064b30d5749.tar.gz
uenv-e81ad1c5c49ce00110daa6c651445064b30d5749.tar.bz2
uenv-e81ad1c5c49ce00110daa6c651445064b30d5749.tar.xz
uenv-e81ad1c5c49ce00110daa6c651445064b30d5749.zip
monitoring.service: Adding a tmux systemd --user file that will launch a named tmux user session with monitoring programs such as htop, glances and loginctl, to attach to within a separate TMUX_TMPDIR set to the user's run directory.
-rw-r--r--user/monitoring.service20
1 files changed, 20 insertions, 0 deletions
diff --git a/user/monitoring.service b/user/monitoring.service
new file mode 100644
index 0000000..88da36b
--- /dev/null
+++ b/user/monitoring.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Monitoring tools in a separate tmux session
+After=network.target local-fs.target
+ConditionFileIsExecutable=/usr/bin/tmux
+ConditionFileIsExecutable=/usr/bin/htop
+ConditionFileIsExecutable=/usr/bin/glances
+ConditionFileIsExecutable=/usr/bin/loginctl
+
+[Service]
+Type=forking
+KillMode=control-group
+Environment=TMUX_TMPDIR=/run/user/%U/tmux
+ExecStart=/usr/bin/tmux -L mon new-session -d -s mon -n htop htop
+ExecStartPost=/usr/bin/tmux -L mon new-window -n glances glances
+ExecStartPost=/usr/bin/tmux -L mon new-window -n loginctl "watch -n1 loginctl user-status %U"
+ExecStop=/usr/bin/tmux -L mon kill-session -t mon
+Restart=on-failure
+
+[Install]
+WantedBy=default.target