Info on sysvinit vs runit – where can it be found??

Forum Forums New users New Users and General Questions Info on sysvinit vs runit – where can it be found??

  • This topic has 32 replies, 10 voices, and was last updated Mar 17-9:05 pm by anticapitalista.
Viewing 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #102302
    Moderator
    Brian Masinick
      Helpful
      Up
      0
      ::

      From https://www.structlog.org/en/16.1.0/logging-best-practices.html

      runit
      One runner that makes this very easy is the venerable runit project which made it a part of its design: server processes don’t detach but log to standard out instead. There it gets processed by other software – potentially by one of its own tools: svlogd. We use it extensively and it has proven itself extremely robust and capable; check out this tutorial if you’d like to try it.

      I think http://smarden.org/runit/svlogd.8.html was mentioned somewhere in the forum too.

      A search, such as managing runit logs finds a lot of stuff; create various search requests with runit and there is no shortage of information.

      --
      Brian Masinick

      #102303
      Moderator
      Brian Masinick
        Helpful
        Up
        0
        ::

        For those who want access to the runit service manager, on our current antiX 22 release it is available at Menu –> Preferences –> runit service manager.

        Logs can – enable, disable, start, stop, or restart.
        Service can – add, remove, enable, disable, start, stop, or restart.

        --
        Brian Masinick

        #102310
        Forum Admin
        anticapitalista
          Helpful
          Up
          0
          ::

          For those who want access to the runit service manager, on our current antiX 22 release it is available at Menu –> Preferences –> runit service manager.

          Logs can – enable, disable, start, stop, or restart.
          Service can – add, remove, enable, disable, start, stop, or restart.

          This is the tool antiX runit users should use.

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

          antiX with runit - leaner and meaner.

          #102311
          Member
          Robin
            Helpful
            Up
            0
            ::

            @calciumsodium

            I have not been able to do crontab jobs in the antiX 21 and antiX 23 a1 runit systems. If someone can show me how, that would be great. The same crontab command that is successful in the sysVinit system would not work in the runit system.

            Maybe this solution is worth to take a look:
            https://salotz.info/posts/runit_snooze/#solution

            Windows is like a submarine. Open a window and serious problems will start.

            #102314
            Member
            Robin
              Helpful
              Up
              0
              ::

              This is the tool antiX runit users should use.

              Please let me know how to start and stop alsa-utils, samba, lm-sensors, timidity, etc. with this tool? I can’t find them in »Runit service control« from antiX control center, neither in the »Listing of Services« nor in the »Listing of Services Currently Not Used« (after clicking on “Add Service” button). Many of the services running on the system fail to answer to sv command on antiX 23. What am I missing, or is it simply not ready yet?
              And what’s the runit replacement on console for sudo service –status-all ? The sv command iteslf doesn’t seem to provide such an option. Do I need to loop through a directory listing for that?

              Windows is like a submarine. Open a window and serious problems will start.

              #102315
              Forum Admin
              anticapitalista
                Helpful
                Up
                0
                ::

                @Robin – that’s precisely why I wrote this post.

                https://www.antixforum.com/forums/topic/info-on-sysvinit-vs-runit-where-can-it-be-found/#post-102295

                I prefer runit, but there is a learning curve if you want more than just a simple set up.
                Although stopping and starting services is quite easy once you know how and for those runit services we provide, it is far from trivial to set up your own eg for pipewire.
                Debian still provides sysVinit ‘service’ scripts for many programmes (though this is declining due to its total commitment to systemd) and next to none for runit.

                Do the apps you mention need a service/startup script?

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

                antiX with runit - leaner and meaner.

                #102318
                Member
                calciumsodium
                  Helpful
                  Up
                  0
                  ::

                  Maybe this solution is worth to take a look:
                  https://salotz.info/posts/runit_snooze/#solution

                  Hi @Robin,

                  Thank you taking the time to write this tip. I will store it away for a time when I want a timer runit script.

                  I found a simple solution that works for me.

                  In sysVinit, I had the crontab job:
                  @reboot rm -r ~/.cache/chromium rm -r ~/.cache/google-chrome

                  When I did the same crontab job in my runit system, it would not work.

                  So I made a simple removecache.sh file:

                  #!/bin/bash
                  rm -r ~/.cache/google-chrome rm -r ~/.cache/chromium

                  Made it executable, placed it in the /usr/local/bin folder.

                  And added the line

                  removecache.sh &

                  in the ~/.desktop-session/startup file.

                  Thanks again for the tip.

                  #102319
                  Member
                  Robin
                    Helpful
                    Up
                    0
                    ::

                    Do the apps you mention need a service/startup script?

                    Not sure about this by now. Sorry for my ignorance, antiX 23 is first time I see runit and will need some time to get used to it. Still learning, reading tons of manuals, try and error…

                    Not sure what to think about this: I understood it that way, »sv« was meant to replace »service« command on runit systems completely. But on antiX 23 alpha I still get:

                    $ sudo sv status smbd
                    fail: status: unable to change to service directory: file does not exist
                    
                    $ sudo sv stop smbd
                    fail: status: unable to change to service directory: file does not exist

                    So I tried to apply the sysvinit syntax from antiX 22 sysvinit:

                    $ sudo service smbd status
                    smbd is running.
                    
                    $ sudo service smbd stop
                    Stopping Samba SMB/CIFS daemon: smbd.
                    

                    Surprisingly this works on runit, and even starts and stops this service properly, while sv can’t do it. So it’s a bit confusingly which of the two commands to use for which system service to check, start and stop.

                    – Concerning alsa-utils: On antiX 22 I needed to restart alsa-utils after modprobing snd_aloop, but on antiX 23 this doesn’t seem to be necessary anymore, alsa seems to be aware of the new loopback device without restarting it. Same after modifications to ~/asoundrc files, on antiX 23 the changes are active immediately after the device was accessed next time, and even present and usable then in the amixer. So I’m not sure whether alsa-utils actually still need a startup script.

                    – Concerning lm-sensors:
                    For some reason I did get an odd reading from antiX conrtrol center → hardware → pc information → full info (section: Sensors), really odd counts. So I’ve writen down a note to mention in next report. But right now, some hours later, the readouts are perfectly fine:

                    Sensors:
                      System Temperatures: cpu: 46.0 C mobo: 36.0 C gpu: radeon temp: 56.5 C
                      Fan Speeds (RPM): cpu: 1406 case-1: 1259
                      Power: 12v: 12.32 5v: N/A 3.3v: 3.42 vbat: N/A

                    So probably these also don’t need to get a startup script, they are running fine out of the box on antiX 23. But for debuging wrong data readouts (e.g. falsely set multipliers for fan speed or temperatures on some hardware) it might be useful to know how to start or stop the respective service after changing its multiplier config file. On antiX 23 by now I didn’t figure how to do it (not even sure whether this is the proper service running, without service –status-all command I don’t know how to get a survey of all running system services):

                    $ service lm-sensors status
                    lm-sensors: unrecognized service
                    
                    $ sudo sv status lm-sensors
                    fail: lm-sensors: unable to change to service directory: file does not exist

                    So I’m not sure at all whether this is actually still the service used to control the sensors on antiX 23, or whether some other tool does this job now.

                    – concerning timidity:
                    Since I’ve switched meanwhile completely to qsynth/fluidsynth, which works way more smoothly and can simply get started when needed from menu and stoped by quiting the GUI window of qsynth (saving resources when not needed running), I’m not sure whether timidity would need a startup script like on antiX 22 sysvinit. But I’ll check it anyway, and report as soon I’ve found out.

                    Windows is like a submarine. Open a window and serious problems will start.

                    #102321
                    Member
                    stevesr0
                      Helpful
                      Up
                      0
                      ::

                      Hi anticapitalista,

                      in your first post in this thread, you mentioned in passing that Pipewire was an example of a program that woould be complicated to setup and (if I understood correctly) you indicated that it could be started as a service using the tool in control centre.

                      You previously stated that Pipewire didn’t have to be started as a runit service, so I am a bit confused.

                      I have been able to run Pipewire on the antiX-23 alpha which is a runit version, just by editing the .desktop-session/startup file.

                      So, is there a use for starting Pipewire as a runit service?

                      Thanks for clarification for this feeble old person.

                      stevesr0

                      #102333
                      Member
                      olsztyn
                        Helpful
                        Up
                        0
                        ::

                        @Stevesr0:
                        My take pending more details from anticapitalista:
                        – Pipewire infrastructure start (including wireplumber) can be configured in the Control Center (Desktop Session Start options) if it works for you to your satisfaction. Particularly if you inject timing delays between starting components). So it is not required to set up an SV runit service for this.
                        – Starting Pipewire as a runit service would ensure a better control of timing when Wireplumber would start, namely after Pipewire and Pipewire-Pulse are fully up, so it would be the ultimate solution. This way was the latest setup @Xecure was running. However defining such runit service appears not trivial in *elogind*-free environment and a conjecture was that @Xecure had this setup still in times when antiX was not yet *elogind*-free, we do not know for sure, I think.
                        – If starting Pipewire sequence from Desktop Session Startup works for you on your setup to your satisfaction then there is no particular need for runit service in your case. However in my testing the need for using timing delays between Pipewire/Wireplumber to ensure correct initialization is a workaround, not a ‘clean’ design. Therefore using runit service for this, such as used in Artix or Devuan would be more ‘elegant’. However (again) a conjecture is that those distros are running libelogind0/elogind, which apparently helps to easier create runit SV service.

                        My note is basically a summary conjecture from prior threads on Pipewire in this forum, not to be construed as any material answer to your questions that you expect from anticapitalista…

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

                        #102341
                        Member
                        Xunzi_23
                          Helpful
                          Up
                          0
                          ::

                          Regarding logging,
                          Important theme, see Samsung SSD problem. Not directly the problem of antiX, but all writes are
                          detrimental to SSD NVME and really bad EMMC which is not only life limited, it is soldered to the board.

                          Brian wrote about Log locations, he missed /home/demo/.desktop-session/current.log and old logs
                          which can be controlled in /usr/local/lib/desktop-session/lib-logging-ds
                          Many thanks to dave and anticapitalista for that.
                          @present I have log level 5 which helps fault finding my very experimental but (up to now) amazingly stable antiX23 setup.

                          Found below in old posts
                          #Moves chromium cache to temp, thanks to xecure
                          #First line only needed if chromium cache exists in home
                          #[ -d “$HOME/.cache/chromium” ] && rm -rf $HOME/.cache/chromium
                          mkdir -p /tmp/demo/.cache/chromium && ln -sf /tmp/demo/.cache/chromium /home/demo/.cache/chromium
                          mkdir -p /tmp/demo/.cache/chromium/Default && ln -sf /tmp/demo/.cache/chromium/Default /home/demo/.cache/chromium/Default

                          Removing the /home/demo/.cache entirely is good for security and memory saving but may cause some applications to misbehave.
                          Cache misuse is common, in some rarer cases it even goes as far as devs storing configuration there.
                          Somewhat slower application startup must also be expected.

                          Advantage is no Gigabyte chrome cache, that can be controlled in options but Mr or Mrs normal user will have no idea what
                          revealing information is to be found. Up to about 9 Months of Browsing history!. Easily and quickly available to anyone
                          inclined to look and unlocked device access.

                          Want to see a shocked person, show them…

                          Hardest application to quieten in as many respects as possible conmann which I will probably remove when a stable antiX version
                          comes along. Despite my config settings constant network checks is a pain. Every second a request and answer. bad.

                          #102371
                          Moderator
                          Brian Masinick
                            Helpful
                            Up
                            0
                            ::

                            Though there are many different logs and multiple places to find them and manage them it’s possible to enable or disable them and it’s certainly possible to remove growing or excessive logs.

                            What is a problem is that I’m doubtful that there is a single place to manage 100% of them. If a SINGLE application can manage all logs, I would like to know what it is and how to identify them.

                            The rumor service manager is able to start, stop, enable and disable logs. If it does more, there’s a lot more to learn. There may be other runit tools; like so many apps it takes research, reading, learning and experience to find and familiarize with anything different.

                            I’ve been using runit for a couple of years, but as far as closely managing it I am in the early stages of learning.

                            --
                            Brian Masinick

                            #102380
                            Forum Admin
                            anticapitalista
                              Helpful
                              Up
                              1
                              ::

                              antiX runit editions provide service files for the following via our own custom-built packages (antiX-22 and antiX-23).
                              Have a look in /etc/sv. Only ‘essential’ services are running by default (ls -la /etc/service/) and services that are also logging can be seen (as root) in var/log/runit. runit-service-manager should also show you all this information.

                              acpi-support
                              anacron
                              avahi-daemon
                              bluetooth
                              connman
                              cron
                              cups
                              dbus
                              dhclient
                              various getty-tty
                              gpm
                              haveged
                              ntpsec
                              rpcbind
                              rsync
                              seatd
                              slimski
                              udevd
                              ufw

                              Debian provides 2 (acpid and ssh).

                              Once user installs applications, it is 99% certain that a runit service file (/etc/sv) is not provided so user has to create their own if needed.
                              This is not trivial.
                              Debian still provides probably 80% of sysVinit startup files if needed (/etc/init.d and symlinks to /etc/rc*).

                              antiX is not 100% ‘pure’ runit like it is implemented on Void and possibly Artix.
                              It is very close though due to the work undertaken by me and Xecure since antiX-19.
                              The benefit of antiX not being 100% pure runit is that users can still use the sysVinit way to start and stop services as @Robin shows in their post (samba IIRC).
                              We cannot provide runit services for every app. Even Debian with its thousands of devs/helpers/packagers won’t do it even when pressed to do so by the init diversity group. Devuan doesn’t do it either. They just keep to how Debian sets up runit, which is basically just running it as pid1 over syVinit runtime scripts (we did this in our first implementation of runit).

                              The pipewire example probably wasn’t a good one. I used it as an example to show how writing runit services is not trivial, especially for complex apps like pipewire, samba etc. Does it need a runit service file? Caprea has shown it fdoesn’t. There isn’t an init startup file for it on sysVinit either.
                              My logic is that if Debian provides an init startup script in /etc/init.d (sysVinit), then you probably need a runit service set up in /etc/sv.

                              Hope this helps.

                              Oh, I forgot to mention that as far as I am aware there is no gui runit sevice manager except our own written by Xecure.
                              Something else: Void, Artix and Devuan do use elogind/libelogind0.

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

                              antiX with runit - leaner and meaner.

                              #102381
                              Moderator
                              Brian Masinick
                                Helpful
                                Up
                                0
                                ::

                                Thank you, that is a very good list for services and an excellent explanation.

                                --
                                Brian Masinick

                                #102407
                                Member
                                olsztyn
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Oh, I forgot to mention that as far as I am aware there is no gui runit sevice manager except our own written by Xecure.

                                  This means to me that antiX is the most developed runit distro…

                                  Something else: Void, Artix and Devuan do use elogind/libelogind0.

                                  Does it mean they do use *elogind*, because it simplifies management? Does *elogind* make it easier to develop runit user services?

                                  Regardless if there are answers to the above questions:
                                  – Debian provides only two runit services
                                  – antiX (anticapitalista plus Xecure) developed additional 19 runit services

                                  This shows how much work has been put into antiX runit to make it the best one among distros…
                                  Thanks anticapitalista and Xecure!

                                  • This reply was modified 1 month, 3 weeks ago by olsztyn.

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

                                Viewing 15 posts - 16 through 30 (of 33 total)
                                • You must be logged in to reply to this topic.