service elogind not always started on boot

Forum Forums Official Releases antiX-21/22 “Grup Yorum” service elogind not always started on boot

  • This topic has 20 replies, 4 voices, and was last updated Dec 23-9:01 am by Xecure.
Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #72605
    Member
    seriousness

      Hello, from time to time I have this issue in my installed antiX-21 runit (updated daily).

      In the logs, I can’t find any hint what inhibits the start of elogind.

      #72649
      Member
      Xecure
        Helpful
        Up
        0
        ::

        Runit just tries to load all services at once at startup, without following any order, so services that require other ones to start before hand sometimes fail, (even if the “dependency” start call runs from inside this service configuration.

        I created a library script that should be included in runit-antix package to load or force-load a runit service that is required by other services. I use it myself, but it hasn’t been tested much by others, and I was planing on improving it, but, well, things happen and it gets put on hold.

        I have the display manager (slimski) start elogind before is starts itself, so that I don’t care much about the race between services. This is my /etc/sv/slimski/run script:

        #!/usr/bin/env /lib/runit/invoke-run
        set -e
        
        NAME="slimski"
        DAEMON=/usr/bin/slimski
        
        DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
        DEFAULT_DISPLAY_MANAGER=$(cat $DEFAULT_DISPLAY_MANAGER_FILE)
        
        # Exit service if DAEMON is not installed
        if [ ! -x $DAEMON ]; then
            exit 161
        fi
        
        # start only if slimski is the default DM
        if [ "$DEFAULT_DISPLAY_MANAGER" != "$DAEMON" ]; then
            exit 161
        fi
        
        # Start elogind first (optional)
        if [ -r /lib/runit/invoke-depend ]; then
            . /lib/runit/invoke-depend
            start_dependency elogind
            start_dependency seatd
        else
            sv start elogind && sv check elogind || true
            sv start seatd && sv check seatd || true
        fi
        
        # Load language code
        . /etc/default/locale
        export LANG=$LANG
        bl=$(awk -F= -v RS=" " '/^lang=/ {print $2}' /proc/cmdline)
        export BLANG=$bl
        
        exec 2>&1
        
        exec $DAEMON

        It will start elogind or seatd if any (or both) are available services, before it starts itself. Try it out yourself (no need to backup the run script, the original is in /usr/share/runit/sv/slimski), and see of future reboots still experience the same issue.

        If you are using a different login manager or you use a service to login without the need of a display manager, let me know and I will try to recommend a different method.

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

        #72688
        Member
        seriousness
          Helpful
          Up
          0
          ::

          Hi Xecure,

          I use the defaults – elogind and slimski. Now I uncommented the line

          # sv start elogind && sv check elogind || true

          in /etc/sv/slimski/run and it seems to work.

          Does runit allow to keep a renamed copy of the original run file in the service directory?

          • This reply was modified 1 year, 4 months ago by seriousness.
          #72736
          Member
          seriousness
            Helpful
            Up
            0
            ::

            Now again: elogind not running. After entering my password, it takes about 2 minutes until desktop appears resp. to get a prompt on tty.

            #72746
            Forum Admin
            anticapitalista
              Helpful
              Up
              0
              ::

              Post output of pstree and ls -la /etc/service/

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

              antiX with runit - leaner and meaner.

              #72748
              Member
              Xecure
                Helpful
                Up
                0
                ::

                Does runit allow to keep a renamed copy of the original run file in the service directory?

                You can make a backup and name it however you like. runit will only load the run and finish scripts (and maybe some other config and check files).

                Replace /etc/sv/elogind/run with:

                #!/usr/bin/env /lib/runit/invoke-run
                set -e
                
                NAME="elogind"
                DAEMON=/usr/lib/elogind/elogind
                
                # Exit service if DAEMON is not installed
                if [ ! -x $DAEMON ]; then
                	exit 161
                fi
                
                # Start dbus first
                if [ -r /lib/runit/invoke-depend ]; then
                    . /lib/runit/invoke-depend
                    force_dependency dbus
                else
                	sv start dbus  &&  sv check dbus  ||  exit 170
                fi
                
                exec 2>&1
                
                exec $DAEMON

                Since using this force_dependency function, I never had any problems anymore with hard dependencies (for both connman and elogind)

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

                #72752
                Member
                seriousness
                  Helpful
                  Up
                  0
                  ::

                  @anti:

                  $ pstree
                  runit─┬─claws-mail───{claws-mail}
                        ├─conky───6*[{conky}]
                        ├─dbus-daemon
                        ├─dbus-launch
                        ├─devmon───udevil
                        ├─gconfd-2
                        ├─palemoon───46*[{palemoon}]
                        ├─roxterm─┬─bash───bash─┬─grep
                        │         │             ├─mpg123───mpg123
                        │         │             └─sed
                        │         ├─bash───pstree
                        │         └─{roxterm}
                        ├─runsvdir─┬─runsv─┬─connmand
                        │          │       └─svlogd
                        │          ├─runsv───slimski─┬─Xorg───6*[{Xorg}]
                        │          │                 └─desktop-session───jwm
                        │          ├─runsv───elogind
                        │          ├─6*[runsv]
                        │          ├─runsv───rpcbind
                        │          ├─6*[runsv───getty]
                        │          ├─runsv───avahi-daemon───avahi-daemon
                        │          ├─runsv───gpm
                        │          ├─runsv───cupsd
                        │          ├─runsv───rsyslogd───3*[{rsyslogd}]
                        │          ├─runsv───dbus-daemon
                        │          ├─runsv───saned
                        │          ├─runsv───haveged
                        │          ├─runsv───sshd
                        │          ├─runsv───udevd
                        │          ├─runsv───bluetoothd
                        │          ├─runsv───cron
                        │          └─runsv───acpid
                        ├─volumeicon
                        └─wpa_supplicant
                  #72753
                  Member
                  seriousness
                    Helpful
                    Up
                    0
                    ::

                    I can’t post the output of ls -la /etc/service/

                    A potentially unsafe operation has been detected in your request to this site

                    Your access to this service has been limited. (HTTP response code 403)

                    If you think you have been blocked in error, contact the owner of this site for assistance.
                    Block Technical Data
                    Block Reason: A potentially unsafe operation has been detected in your request to this site

                    #72754
                    Member
                    seriousness
                      Helpful
                      Up
                      0
                      ::

                      Xecure, I applied your fix. Shall I keep the change in /etc/sv/slimski/run anyway?

                      #72755
                      Forum Admin
                      anticapitalista
                        Helpful
                        Up
                        0
                        ::

                        Ok, pstree seems ok. Try what Xecure suggested.

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

                        antiX with runit - leaner and meaner.

                        #72962
                        Member
                        seriousness
                          Helpful
                          Up
                          0
                          ::

                          Unfortunately, today elogind was down after boot.

                          #73015
                          Member
                          Xecure
                            Helpful
                            Up
                            0
                            ::

                            Change the slimski service to force depend on elogind to force it to start. Edit the run script for slimski I shared earlier and change:
                            start_dependency elogind
                            for:
                            force_dependency elogind

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

                            #73033
                            Member
                            seriousness
                              Helpful
                              Up
                              0
                              ::

                              Done – looks good so far.

                              But now I have these in dmesg:

                              [   15.262850] loginctl[1480]: Failed to connect to bus: No such file or directory
                              [   15.723447] loginctl[1531]: Failed to connect to bus: No such file or directory
                              [   16.154749] loginctl[1548]: Failed to connect to bus: No such file or directory

                              Should I worry?

                              #73310
                              Member
                              seriousness
                                Helpful
                                Up
                                0
                                ::

                                The issue persists. Today elogind was started, Saturday it wasn’t.

                                #73335
                                Member
                                Xecure
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Use runit-service-manager.sh GUI to enable logs for dbus, connman, elogind and slimski.
                                  Next time elogind doesn’t start, check the logs in /var/log/runit/ and share with us any clue you see there.

                                  I have been running runit since antiX 21b1 and tweaked the services that required dependencies until what I shared above.

                                  My hypothesis for your problem is that dbus takes too long to start or fails when called by elogind, which also fails to start, and that leads to this result. It is strange because something similar (connman not starting because f dbus failing to start and then having to manually start it) use to happen to me at the beginning of the beta testing. I no longer have this issue myself.

                                  Could you share
                                  grep -i " elogind\| dbus" /etc/service/*/run
                                  and also
                                  cat /lib/runit/invoke-depend

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

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