aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2022-01-17 19:45:01 -0500
committertdro <tdro@users.noreply.github.com>2022-01-17 19:45:01 -0500
commitd13a2fd835b6273fb6d654a6bacc65d360f0ce19 (patch)
treee660955333ac1bab0fc66c6be14c890e9186fa81
parent5be8c5a1f78f2d7d0cf79c64c82772ce63ffd156 (diff)
downloaddotfiles-d13a2fd835b6273fb6d654a6bacc65d360f0ce19.tar.gz
dotfiles-d13a2fd835b6273fb6d654a6bacc65d360f0ce19.tar.bz2
dotfiles-d13a2fd835b6273fb6d654a6bacc65d360f0ce19.zip
.config/systemd: Cleanup user services
Fail loudly on failure for some units.
-rw-r--r--.config/systemd/user/autocutsel.service7
-rw-r--r--.config/systemd/user/copyq.service6
-rw-r--r--.config/systemd/user/events-idle.service12
-rw-r--r--.config/systemd/user/events-resume.service6
-rw-r--r--.config/systemd/user/events-usb.service6
-rw-r--r--.config/systemd/user/flameshot.service6
-rw-r--r--.config/systemd/user/plank.service6
-rw-r--r--.config/systemd/user/redshift.service7
-rw-r--r--.config/systemd/user/syncthing.service18
-rw-r--r--.config/systemd/user/unclutter.service6
-rw-r--r--.config/systemd/user/x0vncserver.service12
-rw-r--r--.config/systemd/user/x11vnc.service5
-rw-r--r--.config/systemd/user/xbindkeys.service4
13 files changed, 52 insertions, 49 deletions
diff --git a/.config/systemd/user/autocutsel.service b/.config/systemd/user/autocutsel.service
index 82e822b..5d93368 100644
--- a/.config/systemd/user/autocutsel.service
+++ b/.config/systemd/user/autocutsel.service
@@ -1,13 +1,16 @@
[Unit]
Description=Keep the X clipboard and the cutbuffer in sync
+StartLimitBurst=5
+StartLimitIntervalSec=600
+
[Service]
Type=forking
-RestartSec=3s
+RestartSec=3
Restart=always
SyslogIdentifier=autocutsel
-ExecStartPre=/usr/bin/env autocutsel -f -s PRIMARY
ExecStart=/usr/bin/env autocutsel -f -s CLIPBOARD
+ExecStartPre=/usr/bin/env autocutsel -f -s PRIMARY
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/copyq.service b/.config/systemd/user/copyq.service
index cd09ee0..cb1a057 100644
--- a/.config/systemd/user/copyq.service
+++ b/.config/systemd/user/copyq.service
@@ -1,12 +1,14 @@
[Unit]
Description=Copyq server
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
Type=simple
-ExecStart=/usr/bin/env copyq
+RestartSec=3
Restart=always
-RestartSec=5s
SyslogIdentifier=copyq
+ExecStart=/usr/bin/env copyq
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/events-idle.service b/.config/systemd/user/events-idle.service
index 7c5cdec..095b1d8 100644
--- a/.config/systemd/user/events-idle.service
+++ b/.config/systemd/user/events-idle.service
@@ -1,15 +1,17 @@
[Unit]
Description=Execute events on X11 idle
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
Type=simple
-ExecStartPre=/usr/bin/env sh -c '%h/.local/bin/scripts/events-idle'
-ExecStart=/usr/bin/env sh -c 'while true; do sleep 300 && [ "$(xprintidle)" -gt 120000 ] && %h/.local/bin/scripts/events-idle; done'
+IOWeight=60
+CPUQuota=60%
+RestartSec=5
Restart=always
-RestartSec=5s
SyslogIdentifier=events-idle
-CPUQuota=60%
-IOWeight=60
+ExecStartPre=/usr/bin/env sh -c '%h/.local/bin/scripts/events-idle'
+ExecStart=/usr/bin/env sh -c 'while true; do sleep 300 && [ "$(xprintidle)" -gt 120000 ] && %h/.local/bin/scripts/events-idle; done'
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/events-resume.service b/.config/systemd/user/events-resume.service
index b8bce6a..98724d0 100644
--- a/.config/systemd/user/events-resume.service
+++ b/.config/systemd/user/events-resume.service
@@ -1,12 +1,14 @@
[Unit]
Description=Execute events on resume event
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
Type=simple
-ExecStart=/usr/bin/env sh -c 'dbus-monitor --system | while read; do grep -q 'PrepareForSleep' && %h/.local/bin/scripts/events-resume; done'
+RestartSec=3
Restart=always
-RestartSec=5s
SyslogIdentifier=events-resume
+ExecStart=/usr/bin/env sh -c 'dbus-monitor --system | while read; do grep -q 'PrepareForSleep' && %h/.local/bin/scripts/events-resume; done'
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/events-usb.service b/.config/systemd/user/events-usb.service
index d2a5b63..030a0c3 100644
--- a/.config/systemd/user/events-usb.service
+++ b/.config/systemd/user/events-usb.service
@@ -1,12 +1,14 @@
[Unit]
Description=Execute events on kernel usb events
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
Type=simple
-ExecStart=/usr/bin/env sh -c 'udevadm monitor | while read; do grep -m1 -q "(usb)" && %h/.local/bin/scripts/events-usb; done'
+RestartSec=3
Restart=always
-RestartSec=5s
SyslogIdentifier=events-usb
+ExecStart=/usr/bin/env sh -c 'udevadm monitor | while read; do grep -m1 -q "(usb)" && %h/.local/bin/scripts/events-usb; done'
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/flameshot.service b/.config/systemd/user/flameshot.service
index 431fc04..caf212e 100644
--- a/.config/systemd/user/flameshot.service
+++ b/.config/systemd/user/flameshot.service
@@ -1,12 +1,14 @@
[Unit]
Description=Screenshot tool
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
Type=simple
-ExecStart=/usr/bin/env flameshot
+RestartSec=3
Restart=always
-RestartSec=5s
SyslogIdentifier=flameshot
+ExecStart=/usr/bin/env flameshot
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/plank.service b/.config/systemd/user/plank.service
index 4f92af7..760e71b 100644
--- a/.config/systemd/user/plank.service
+++ b/.config/systemd/user/plank.service
@@ -4,12 +4,12 @@ StartLimitIntervalSec=0
[Service]
Type=simple
-Environment=XDG_SESSION_TYPE=X11
-ExecStart=/usr/bin/env plank
+RestartSec=1
Restart=always
-RestartSec=1s
KillMode=process
SyslogIdentifier=plank
+ExecStart=/usr/bin/env plank
+Environment=XDG_SESSION_TYPE=X11
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/redshift.service b/.config/systemd/user/redshift.service
index e18f1e4..c1ef6a3 100644
--- a/.config/systemd/user/redshift.service
+++ b/.config/systemd/user/redshift.service
@@ -1,12 +1,15 @@
[Unit]
Description=Redshift
+StartLimitBurst=5
+StartLimitIntervalSec=600
+
[Service]
Type=simple
-ExecStart=/usr/bin/env redshift
+RestartSec=3
Restart=always
-RestartSec=5s
SyslogIdentifier=redshift
+ExecStart=/usr/bin/env redshift
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/syncthing.service b/.config/systemd/user/syncthing.service
index d1b862c..7683fad 100644
--- a/.config/systemd/user/syncthing.service
+++ b/.config/systemd/user/syncthing.service
@@ -1,21 +1,15 @@
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
-After=network.target
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
-ExecStart=/usr/bin/env syncthing -no-browser -no-restart -logflags=0
+IOWeight=60
+CPUQuota=60%
+RestartSec=3
Restart=always
-RestartSec=5s
SyslogIdentifier=syncthing
-CPUQuota=60%
-IOWeight=60
-
-# Hardening
-ProtectSystem=full
-PrivateTmp=true
-SystemCallArchitectures=native
-MemoryDenyWriteExecute=true
-NoNewPrivileges=true
+ExecStart=/usr/bin/env syncthing -no-browser -no-restart -logflags=0
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/unclutter.service b/.config/systemd/user/unclutter.service
index ac4941c..03313f0 100644
--- a/.config/systemd/user/unclutter.service
+++ b/.config/systemd/user/unclutter.service
@@ -1,12 +1,14 @@
[Unit]
Description=Hide mouse on idle
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
Type=simple
-ExecStart=/usr/bin/env unclutter -idle 1
+RestartSec=3
Restart=always
-RestartSec=5s
SyslogIdentifier=unclutter
+ExecStart=/usr/bin/env unclutter -idle 1
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/x0vncserver.service b/.config/systemd/user/x0vncserver.service
deleted file mode 100644
index e3e1abe..0000000
--- a/.config/systemd/user/x0vncserver.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Remote desktop service (VNC)
-
-[Service]
-Type=forking
-ExecStart=/usr/bin/env /usr/bin/sh -c '/usr/bin/x0vncserver -rfbport 5900 -RemapKeys="0x3c->0x2c" -passwordfile %h/.vnc/passwd &'
-Restart=always
-RestartSec=5s
-SyslogIdentifier=x0vncserver
-
-[Install]
-WantedBy=default.target
diff --git a/.config/systemd/user/x11vnc.service b/.config/systemd/user/x11vnc.service
index 98e6fe7..1e0ce0c 100644
--- a/.config/systemd/user/x11vnc.service
+++ b/.config/systemd/user/x11vnc.service
@@ -1,10 +1,11 @@
[Unit]
Description=Remote desktop service (VNC)
-StartLimitIntervalSec=0
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
Type=simple
-RestartSec=1s
+RestartSec=3
Restart=always
SyslogIdentifier=x11vnc
ExecStart=/usr/bin/env x11vnc -display $DISPLAY -rfbport 5900 -shared -usepw -forever -nowireframe -norepeat -noxdamage -noxrecord -ncache_cr -noxfixes -auth $XAUTHORITY
diff --git a/.config/systemd/user/xbindkeys.service b/.config/systemd/user/xbindkeys.service
index 82eaf76..8ec94a4 100644
--- a/.config/systemd/user/xbindkeys.service
+++ b/.config/systemd/user/xbindkeys.service
@@ -1,9 +1,11 @@
[Unit]
Description=Keyboard shortcut binder
+StartLimitBurst=5
+StartLimitIntervalSec=600
[Service]
Type=simple
-RestartSec=5s
+RestartSec=3
Restart=always
KillMode=process
SyslogIdentifier=xbindkeys