blob: 8bb39090b0d968f5f56ef8033b1df0d48457d722 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
[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=%t/tmux
ExecStartPre=/usr/bin/mkdir -p $TMUX_TMPDIR
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
|