“magic sysrq” in antiX runit

Forum Forums Official Releases antiX-21/22 “Grup Yorum” “magic sysrq” in antiX runit

  • This topic has 10 replies, 4 voices, and was last updated Dec 27-8:26 am by seriousness.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #73547
    Member
    seriousness

      Though I never experienced an XServer freeze in antiX, I’d like to have the possibility to do a clean shutdown/reboot, if it once happens. In kernel 4.9.0-279-antix.1-amd64-smp, magic sysrq is disabled by default. Creating /etc/sysctl.d/10-magic-sysrq.conf does not work. Is there a way to enable magic sysrq with runit or an alternative method to do a clean shutdown/reboot?

      #73548
      Forum Admin
      anticapitalista
        Helpful
        Up
        0
        ::

        Warning
        Magic SysRq should not be enabled in kernel for production or mission critical systems! Even if Magic SysRq is disabled at boot using for example sysctl, it still leaves /proc/sysrq-trigger open. Not to mention the fact that re-enabling SysRq is as easy as disabling it.

        https://wiki.gentoo.org/wiki/Magic_SysRQ

        Philosophers have interpreted the world in many ways; the point is to change it.

        antiX with runit - leaner and meaner.

        #73552
        Member
        seriousness
          Helpful
          Up
          0
          ::

          re-enabling SysRq is as easy as disabling it

          but how, if /etc/sysctl.d/10-magic-sysrq.conf is not read and I’m not capable of building my own kernel?

          #73555
          Member
          Xecure
            Helpful
            Up
            0
            ::

            @anticapitalista, I think there is a bug in /etc/runit-core/S13procps

            Maybe at the end of the file, it should say:

            case "$1" in
              start)
            	do_start_cmd
              	;;
            esac

            @seriousness, could you try making the edit and restarting to see if /etc/sysctl.d/10-magic-sysrq.conf now loads properly?

            • This reply was modified 1 year, 4 months ago by Xecure.

            antiX Live system enthusiast.
            General Live Boot Parameters for antiX.

            #73557
            Forum Admin
            anticapitalista
              Helpful
              Up
              0
              ::

              @Xecure – the original procps (sysvinit) script doesn’t have it.

              @seriousness – please post output of

              ls -la /etc/rc*.d

              Philosophers have interpreted the world in many ways; the point is to change it.

              antiX with runit - leaner and meaner.

              #73559
              Member
              seriousness
                Helpful
                Up
                0
                ::

                *** Forbidden. Message seems to be spam. ***

                Attachments:
                #73562
                Member
                Xecure
                  Helpful
                  Up
                  0
                  ::

                  @Xecure – the original procps (sysvinit) script doesn’t have it.

                  That is because the init script in sysvinit has this at the top

                  if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
                      set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
                  fi

                  so it runs the sourced script. On runit we need to add the extra code for the file to run do_start_cmd, me thinks. I will test it out in a bit on next reboot.

                  antiX Live system enthusiast.
                  General Live Boot Parameters for antiX.

                  #73583
                  Member
                  Xecure
                    Helpful
                    Up
                    1
                    ::

                    Using “the fix” in antiX 21-runit, I get the correct swappiness

                    $ cat /proc/sys/vm/swappiness
                    10

                    which is configured in /etc/sysctl.conf

                    #added by antiX
                    vm.swappiness = 10

                    Using the original /etc/runit-core/S13procps, my swappiness is 60, meaning the /etc/sysctl.conf configuration was not loaded.

                    @seriousness, can you see if editing the file and adding the change proposed and rebooting activates the magic sysrq option?

                    antiX Live system enthusiast.
                    General Live Boot Parameters for antiX.

                    #73585
                    Forum Admin
                    anticapitalista
                      Helpful
                      Up
                      0
                      ::

                      Thanks @Xecure – I’ll update the package with the fix.

                      Philosophers have interpreted the world in many ways; the point is to change it.

                      antiX with runit - leaner and meaner.

                      #73607
                      Member
                      ModdIt
                        Helpful
                        Up
                        0
                        ::

                        Maybe good to add that those with the luxury of 4 or even 8GB memory and an SSD
                        might like to set swappiness to 1 or even 0.

                        Remembering that newer consumer SSD are write cycle optimised devices, samsung
                        speak for older ones lasted too long, hidden in marketing drivel was expectation
                        of 3 years before device replacement. My youngest computer is 12 years old.

                        #73791
                        Member
                        seriousness
                          Helpful
                          Up
                          0
                          ::

                          Hey Xecure, I applied your fix and it works.

                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.