CONTRIBUTION: libvirt runit service files

Forum Forums Official Releases antiX-21/22 “Grup Yorum” CONTRIBUTION: libvirt runit service files

  • This topic has 9 replies, 3 voices, and was last updated Apr 21-12:37 pm by techore.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #105032
    Member
    techore

      I created runit service files for libvirt and accompanying services; virtlock and virtlog. I created these for use with Virtual Machine Manager but they are agnostic.

      git repo: libvirt-runit

      Example service file:

      #!/usr/bin/env /lib/runit/invoke-run
      set -e
      
      NAME="libvirtd"
      DAEMON=/usr/sbin/libvirtd
      
      # Exit service if DAEMON is not installed
      if [ ! -x $DAEMON ]; then
      	exit 161
      fi
      
      # Start dbus first
      sv start dbus  &&  sv check dbus  ||  exit 170
      
      # Load defaults
      [ -f ./conf ] && . ./conf
      
      exec 2>&1
      
      exec $DAEMON ${OPTS}
      #105039
      Member
      olsztyn
        Helpful
        Up
        1
        ::

        I created runit service files for libvirt and accompanying services; virtlock and virtlog. I created these for use with Virtual Machine Manager but they are agnostic.

        Thank you… Greatly appreciated. Very needed for QEMu/VMM.
        Just a question: Is this VM infrastructure now compatible with antiX being libelogind0? It has been some some since I gave up on this for antiX but looking forward to another attempt to implement. I do not recall specific issues I was facing at that time.

        Live antiX Boot Options (Previously posted by Xecure):
        https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

        #105059
        Member
        techore
          Helpful
          Up
          0
          ::

          Just a question: Is this VM infrastructure now compatible with antiX being libelogind0?

          Good question. I am working on the antix-dwm 22 Release 3 and added a libelogind0 check. Release 3 is using seatd, so.. I will update with the results but give me a day or two. Work is keeping me busy.

          and,

          I still need to resolve the missing network bridge for use with virtual machines versus a NAT. Been a long while since my initial research. If anyone has a solution or recommendation, love to hear it and get another “To Do” item checked off.

          • This reply was modified 2 weeks, 5 days ago by techore.
          #105061
          Member
          olsztyn
            Helpful
            Up
            0
            ::

            Good question. I am working on the antix-dwm 22 Release 3 and added a libelogind0 check. Release 3 is using seatd, so.. I will update with the results but give me a day or two.

            Thank you. Any info will be greatly appreciated but no rush for me. Normally I would attempt to put this infrastructure together and see what it entails, but these weeks I will be quite busy preparing for my trip to Europe, so might be unable to dedicate lots of time very soon.
            Thanks and regards…

            Live antiX Boot Options (Previously posted by Xecure):
            https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

            #105064
            Forum Admin
            anticapitalista
              Helpful
              Up
              2
              ::
               apt install virt-manager 
              Reading package lists... Done
              Building dependency tree... Done
              Reading state information... Done
              The following additional packages will be installed:
                gir1.2-gtk-vnc-2.0 gir1.2-gtksource-4 gir1.2-libvirt-glib-1.0 libgtk-vnc-2.0-0 libgtksourceview-4-0 libgtksourceview-4-common libgvnc-1.0-0
                libvirt-glib-1.0-0 python3-libvirt virtinst
              Suggested packages:
                gnome-keyring python3-guestfs virt-viewer python3-argcomplete
              Recommended packages:
                libvirt-daemon gir1.2-spiceclientglib-2.0 gir1.2-spiceclientgtk-3.0 libvirt-daemon-system libvirt-clients qemu-utils virt-viewer
              The following NEW packages will be installed:
                gir1.2-gtk-vnc-2.0 gir1.2-gtksource-4 gir1.2-libvirt-glib-1.0 libgtk-vnc-2.0-0 libgtksourceview-4-0 libgtksourceview-4-common libgvnc-1.0-0
                libvirt-glib-1.0-0 python3-libvirt virt-manager virtinst
              0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
              Need to get 2,553 kB of archives.
              After this operation, 14.4 MB of additional disk space will be used.
              Do you want to continue? [Y/n] n

              So on antiX-22, virt-manager does not require any elogind.

              Thanks to @techore for providing runit scripts.

              I have a question or two though.
              I noticed that your instructions at your gitlab repo says to symlink /etc/sv/* to /etc/runit/runsvdir/default/*
              Why?

              antiX also puts any runit service scripts in /usr/share/runit/sv/
              The ones in /etc/sv/ can/should (perhaps) be edited by user and should not be overwritten by any updates.
              The ones that get overwritten are the ones in /usr/share/runit/sv/

              antiX symlinks the runit services in /etc/sv/ to /etc/service/

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

              antiX with runit - leaner and meaner.

              #105105
              Member
              techore
                Helpful
                Up
                0
                ::

                I noticed that your instructions at your gitlab repo says to symlink /etc/sv/* to /etc/runit/runsvdir/default/*
                Why?

                I did it based on observing the symlinks in /etc/runit/runsvdir/default/ linking to /etc/sv/. Sounds like I came to the wrong conclusion. 🙂

                antiX also puts any runit service scripts in /usr/share/runit/sv/
                The ones in /etc/sv/ can/should (perhaps) be edited by user and should not be overwritten by any updates.
                The ones that get overwritten are the ones in /usr/share/runit/sv/

                antiX symlinks the runit services in /etc/sv/ to /etc/service/

                @anticapitalista, reading above, I do not understand how to correctly setup antiX runit services. _sorry?_ 🙂

                I believe you are recommending to place the service run and a finish(?) files into /usr/share/runit/sv/. Done and on reboot I see no other changes, so there must be more to do. I, also, see the symlinks linking from /etc/services/ and /etc/runit/runsvdir/default/ to /etc/sv/. Do I create those as well with a /log/run?

                I appreciate you mentoring me and your time.

                #105109
                Forum Admin
                anticapitalista
                  Helpful
                  Up
                  1
                  ::

                  I suggest what you include in /etc/sv/ should also be put in /usr/share/runit/sv
                  Some runit service files need only run (seatd). Some need run and finish (cron, slimski). Others need run, finish and check (dbus, udevd).
                  Which needs what is down to trial and error it seems.
                  I usually try what void linux has.

                  /etc/sv/* should be linked to /etc/service/*
                  /etc/runit/runsvdir/default should pick up what is in /etc/service

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

                  antiX with runit - leaner and meaner.

                  #105126
                  Member
                  techore
                    Helpful
                    Up
                    0
                    ::

                    @anticapitalist, thank you!

                    I updated the git repo and your additional instructions were very clear. Much appreciated.

                    #105143
                    Member
                    olsztyn
                      Helpful
                      Up
                      0
                      ::

                      @anticapitalist, thank you!

                      I updated the git repo and your additional instructions were very clear. Much appreciated.

                      Regarding the above quote from @techore, which somehow did not come through as quoted in this post:
                      I just want to thank you for pursuing this to refining details and anticapitalista for help. After returning from my travel to Europe I will permanently install QEMU/VMM into my flagship antiX image based on antiX 23…
                      Also I am looking forward to hearing about the NAT/bridge network solution, as I remember running into the same question some time ago when I played with QEMu/VMM, but never had a chance to dig into this. The thing I recall was security setting being a member of libvirt group as part of this. I will play again with these after coming back from Europe in two months or so…

                      • This reply was modified 2 weeks, 3 days ago by olsztyn.

                      Live antiX Boot Options (Previously posted by Xecure):
                      https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

                      #105146
                      Member
                      techore
                        Helpful
                        Up
                        0
                        ::

                        Also I am looking forward to hearing about the NAT/bridge network solution, as I remember running into the same question some time ago when I played with QEMu/VMM, but never had a chance to dig into this. The thing I recall was security setting being a member of libvirt group as part of this. I will play again with these after coming back from Europe in two months or so…

                        Glad that I was able to contribute something back to our community.

                        On the bridge interface, I just need to take the time out and dig in. It has been on my antiX “To do” list for six months and I’ve done it with RHEL and other Linux distos in the past. Once I get it puzzled out, I will post with instructions. No PM so I’ll @olsztyn to get your attention.

                        Safe journey!

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