From 3b03b97e839904470d73c41bab3a02921cb59bae Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 15 Mar 2024 22:14:41 +0100 Subject: [PATCH] Add systemd config files --- README.md | 10 ++++++++++ install.sh | 15 ++++++++++++++- systemd/coredump.conf | 5 +++++ systemd/journald.conf | 24 ++++++++++++++++++++++++ systemd/logind.conf | 21 +++++++++++++++++++++ systemd/networkd.conf | 5 +++++ systemd/oomd.conf | 2 ++ systemd/pstore.conf | 2 ++ systemd/resolved.conf | 8 ++++++++ systemd/sleep.conf | 5 +++++ systemd/system.conf | 9 +++++++++ systemd/user.conf | 8 ++++++++ uninstall.sh | 12 ++++++++++++ 13 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 systemd/coredump.conf create mode 100644 systemd/journald.conf create mode 100644 systemd/logind.conf create mode 100644 systemd/networkd.conf create mode 100644 systemd/oomd.conf create mode 100644 systemd/pstore.conf create mode 100644 systemd/resolved.conf create mode 100644 systemd/sleep.conf create mode 100644 systemd/system.conf create mode 100644 systemd/user.conf diff --git a/README.md b/README.md index 5a3aa91..33701e7 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,16 @@ Running `install.sh` or `uninstall.sh` will delete and change some things in you - /etc/makepkg.conf - /etc/mkinitcpio.conf - /etc/sudo.conf +- /etc/systemd/coredump.conf +- /etc/systemd/journald.conf +- /etc/systemd/logind.conf +- /etc/systemd/networkd.conf +- /etc/systemd/oomd.conf +- /etc/systemd/pstore.conf +- /etc/systemd/resolved.conf +- /etc/systemd/sleep.conf +- /etc/systemd/system.conf +- /etc/systemd/user.conf ## Recommendation Please, do not modify any files. It will only cause issues during the update process. \ diff --git a/install.sh b/install.sh index 11e22d3..2476150 100755 --- a/install.sh +++ b/install.sh @@ -46,6 +46,18 @@ link "archlinux/paru.conf" "etc/paru.conf" link "archlinux/makepkg.conf" "etc/makepkg.conf" link "archlinux/mkinitcpio.conf" "etc/mkinitcpio.conf" +# systemd +link "systemd/coredump.conf" "etc/systemd/coredump.conf" +link "systemd/journald.conf" "etc/systemd/journald.conf" +link "systemd/logind.conf" "etc/systemd/logind.conf" +link "systemd/networkd.conf" "etc/systemd/networkd.conf" +link "systemd/oomd.conf" "etc/systemd/oomd.conf" +link "systemd/pstore.conf" "etc/systemd/pstore.conf" +link "systemd/resolved.conf" "etc/systemd/resolved.conf" +link "systemd/sleep.conf" "etc/systemd/sleep.conf" +link "systemd/system.conf" "etc/systemd/system.conf" +link "systemd/user.conf" "etc/systemd/user.conf" + # programs link "lone-files/sudo.conf" "etc/sudo.conf" @@ -56,5 +68,6 @@ link "bin/updater" "usr/local/bin/sysdotfiles-updater" # write install file echo "pls don't remove" > "/etc/.jstm_sysdotfiles" -# regenerate locales +# do post-install stuff locale-gen +systemctl reload-daemon diff --git a/systemd/coredump.conf b/systemd/coredump.conf new file mode 100644 index 0000000..e757d59 --- /dev/null +++ b/systemd/coredump.conf @@ -0,0 +1,5 @@ +[Coredump] +Storage=journal +Compress=yes +ProcessSizeMax=1G +MaxUse=3G diff --git a/systemd/journald.conf b/systemd/journald.conf new file mode 100644 index 0000000..3f3194e --- /dev/null +++ b/systemd/journald.conf @@ -0,0 +1,24 @@ +[Journal] +Storage=auto +Compress=yes +SplitMode=uid +SyncIntervalSec=1m +SystemMaxUse=512M +#SystemKeepFree= +#SystemMaxFileSize= +#SystemMaxFiles=100 +#RuntimeMaxUse= +#RuntimeKeepFree= +#RuntimeMaxFileSize= +#RuntimeMaxFiles=100 +MaxRetentionSec=1week +MaxFileSec=1day +ForwardToSyslog=no +ForwardToKMsg=true +ForwardToConsole=no +ForwardToWall=true +MaxLevelKMsg=warn +MaxLevelWall=emerg +LineMax=48K +ReadKMsg=yes +Audit=yes diff --git a/systemd/logind.conf b/systemd/logind.conf new file mode 100644 index 0000000..bc3ebc2 --- /dev/null +++ b/systemd/logind.conf @@ -0,0 +1,21 @@ +[Login] +NAutoVTs=10 +ReserveVT=10 +KillUserProcesses=yes +KillExcludeUsers=root +UserStopDelaySec=10 +HandlePowerKey=poweroff +HandlePowerKeyLongPress=ignore +HandleRebootKey=reboot +HandleRebootKeyLongPress=poweroff +HandleSuspendKey=suspend +HandleSuspendKeyLongPress=ignore +HandleHibernateKey=hibernate +HandleHibernateKeyLongPress=ignore +HandleLidSwitch=suspend +HandleLidSwitchExternalPower=suspend +HoldoffTimeoutSec=30s +IdleAction=ignore +RuntimeDirectorySize=10% +RemoveIPC=yes +StopIdleSessionSec=infinity diff --git a/systemd/networkd.conf b/systemd/networkd.conf new file mode 100644 index 0000000..99776cb --- /dev/null +++ b/systemd/networkd.conf @@ -0,0 +1,5 @@ +[Network] +SpeedMeter=no +ManageForeignRoutingPolicyRules=yes +ManageForeignRoutes=yes +IPv6PrivacyExtensions=no diff --git a/systemd/oomd.conf b/systemd/oomd.conf new file mode 100644 index 0000000..c68482c --- /dev/null +++ b/systemd/oomd.conf @@ -0,0 +1,2 @@ +[OOM] +SwapUsedLimit=85% diff --git a/systemd/pstore.conf b/systemd/pstore.conf new file mode 100644 index 0000000..a8a16d5 --- /dev/null +++ b/systemd/pstore.conf @@ -0,0 +1,2 @@ +[PStore] +Storage=journal diff --git a/systemd/resolved.conf b/systemd/resolved.conf new file mode 100644 index 0000000..00255b5 --- /dev/null +++ b/systemd/resolved.conf @@ -0,0 +1,8 @@ +[Resolve] +DNS=127.0.0.1 +DNS=::1 +FallbackDNS=127.0.0.1 +FallbackDNS=::1 +Cache=no +CacheFromLocalhost=no +DNSStubListener=no diff --git a/systemd/sleep.conf b/systemd/sleep.conf new file mode 100644 index 0000000..0ff7604 --- /dev/null +++ b/systemd/sleep.conf @@ -0,0 +1,5 @@ +[Sleep] +AllowSuspend=false +AllowHibernation=false +AllowSuspendThenHibernate=false +AllowHybridSleep=false diff --git a/systemd/system.conf b/systemd/system.conf new file mode 100644 index 0000000..9a38202 --- /dev/null +++ b/systemd/system.conf @@ -0,0 +1,9 @@ +[Manager] +LogLevel=info +LogColor=yes +LogLocation=no +LogTime=no +DumpCore=yes +CtrlAltDelBurstAction=reboot-force +DefaultTimeoutStartSec=20s +DefaultTimeoutStopSec=20s diff --git a/systemd/user.conf b/systemd/user.conf new file mode 100644 index 0000000..0953daf --- /dev/null +++ b/systemd/user.conf @@ -0,0 +1,8 @@ +[Manager] +LogLevel=info +LogTarget=auto +LogColor=yes +LogLocation=no +LogTime=no +DefaultTimeoutStartSec=20s +DefaultTimeoutStopSec=20s diff --git a/uninstall.sh b/uninstall.sh index 683443c..8dc928e 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -33,6 +33,18 @@ unlink "etc/paru.conf" unlink "etc/makepkg.conf" unlink "etc/mkinitcpio.conf" +# systemd +unlink "etc/systemd/coredump.conf" +unlink "etc/systemd/journald.conf" +unlink "etc/systemd/logind.conf" +unlink "etc/systemd/networkd.conf" +unlink "etc/systemd/oomd.conf" +unlink "etc/systemd/pstore.conf" +unlink "etc/systemd/resolved.conf" +unlink "etc/systemd/sleep.conf" +unlink "etc/systemd/system.conf" +unlink "etc/systemd/user.conf" + # programs unlink "etc/sudo.conf"