aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@rak.ac>2025-10-18 13:45:59 -0400
committerRyan Kavanagh <rak@rak.ac>2025-10-18 13:45:59 -0400
commit99ef1ba0da1dee9cd3da987ed84214b65816e98c (patch)
tree28e85faaa62b6c3842acd931d59199fd7c2cde42
parentmpd config (diff)
add local systemd plocate timer to update llocate dbHEADmaster
Diffstat (limited to '')
-rw-r--r--dot_config/systemd/user/plocate-updatedb.service28
-rw-r--r--dot_config/systemd/user/plocate-updatedb.timer11
-rw-r--r--dot_config/systemd/user/timers.target.wants/symlink_plocate-updatedb.timer1
3 files changed, 40 insertions, 0 deletions
diff --git a/dot_config/systemd/user/plocate-updatedb.service b/dot_config/systemd/user/plocate-updatedb.service
new file mode 100644
index 0000000..55620c5
--- /dev/null
+++ b/dot_config/systemd/user/plocate-updatedb.service
@@ -0,0 +1,28 @@
+[Unit]
+Description=Update the plocate database
+ConditionACPower=true
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/updatedb.plocate -l 0 -o "${XDG_STATE_HOME}/plocate/home.db" -U "${HOME}"
+LimitNOFILE=131072
+IOSchedulingClass=idle
+Nice=19
+
+CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_CHOWN
+IPAddressDeny=any
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+PrivateTmp=true
+PrivateDevices=true
+PrivateNetwork=true
+ProtectClock=true
+ProtectControlGroups=true
+ProtectHostname=true
+RestrictAddressFamilies=AF_UNIX
+RestrictNamespaces=true
+RestrictRealtime=true
+RestrictSUIDSGID=true
+SystemCallArchitectures=native
+SystemCallFilter=@system-service @chown
diff --git a/dot_config/systemd/user/plocate-updatedb.timer b/dot_config/systemd/user/plocate-updatedb.timer
new file mode 100644
index 0000000..1d25abb
--- /dev/null
+++ b/dot_config/systemd/user/plocate-updatedb.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=Update the plocate database daily
+
+[Timer]
+OnCalendar=daily
+RandomizedDelaySec=1h
+AccuracySec=6h
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/dot_config/systemd/user/timers.target.wants/symlink_plocate-updatedb.timer b/dot_config/systemd/user/timers.target.wants/symlink_plocate-updatedb.timer
new file mode 100644
index 0000000..28d405c
--- /dev/null
+++ b/dot_config/systemd/user/timers.target.wants/symlink_plocate-updatedb.timer
@@ -0,0 +1 @@
+/home/rak/.config/systemd/user/plocate-updatedb.timer