diff --git a/etc/profile.d/30_security-misc.sh b/etc/profile.d/30_security-misc.sh index 351d3ed..2ab169d 100755 --- a/etc/profile.d/30_security-misc.sh +++ b/etc/profile.d/30_security-misc.sh @@ -9,8 +9,3 @@ fi if ! echo "$XDG_CONFIG_DIRS" | grep --quiet /usr/share/security-misc/ ; then export XDG_CONFIG_DIRS=/usr/share/security-misc/:$XDG_CONFIG_DIRS fi - -if [ -x /usr/libexec/security-misc/panic-on-oops ]; then - ## Hide output. Otherwise could confuse Qubes UpdatesProxy. - sudo --non-interactive /usr/libexec/security-misc/panic-on-oops 1>/dev/null 2>/dev/null -fi diff --git a/usr/lib/systemd/system/panic-on-oops.service b/usr/lib/systemd/system/panic-on-oops.service new file mode 100644 index 0000000..cf13053 --- /dev/null +++ b/usr/lib/systemd/system/panic-on-oops.service @@ -0,0 +1,20 @@ +## Copyright (C) 2024 - 2024 ENCRYPTED SUPPORT LP +## See the file COPYING for copying conditions. + +[Unit] +Description=Sets 'sysctl kernel.panic_on_oops=1' late during the boot process. +Documentation=https://github.com/Kicksecure/security-misc + +ConditionKernelCommandLine=!panic-on-oops=0 + +After=multi-user.target +After=graphical.target +After=getty.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/libexec/security-misc/panic-on-oops + +[Install] +WantedBy=multi-user.target