From e81ad1c5c49ce00110daa6c651445064b30d5749 Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 20 Mar 2015 03:35:53 +0100 Subject: 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. --- user/monitoring.service | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 user/monitoring.service 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 -- cgit v1.2.3-70-g09d2