How to autologin from console with runit?

Forum Forums General Software How to autologin from console with runit?

  • This topic has 10 replies, 4 voices, and was last updated Nov 4-10:35 pm by Vincent17.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #55474
    Moderator
    christophe

      I’ve been playing with antiX sid runit. I installed X, but I use startx (xinit) to launch it, so no slim display/login manager. Anyways, I’d like to automatically login. With sysvinit, I’d change /etc/inittab a certin way, but it isn’t working with runit. Web search gives me nothing.
      So, how do I login automatically with runit (from console)?

      confirmed antiX frugaler, since 2019

      #55480
      Member
      ex_Koo
        Helpful
        Up
        0
        ::

        Control Panel > Maintenance > User Manager > Options > Modify User Account > YOU > Change Autologin Settings > Log in Automatically.

        Open Control Panel from console = antixcc.sh

        Also if you make a .bash_profile file and add below it will Automatically startx after logging in.

        #
        # ~/.bash_profile
        #
        
        [[ -f ~/.bashrc ]] && . ~/.bashrc
        
        [[ $(fgconsole 2>/dev/null) == 1 ]] && exec startx -- vt1
        • This reply was modified 2 years, 2 months ago by ex_Koo.
        #55483
        Moderator
        christophe
          Helpful
          Up
          0
          ::

          Thanks, Koo.

          To clarify, I built this up from core. I don’t have antix control centre. Do you know of another way? (GUI-less, probably.)

          But thank you for that code snippet for starting x. I might swap that in, instead instead of my current way, to see the difference.

          confirmed antiX frugaler, since 2019

          #55484
          Anonymous
            Helpful
            Up
            0
            ::

            christophe, from startpage.com websearch query “runit autologin”
            seems to provide an exact answer https://wiki.voidlinux.org/Automatic_Login_to_Graphical_Environment
            and, a “working example” posted here: https://old.reddit.com/r/voidlinux/comments/ieyp7l/autologin_on_tty1_just_once/

            also, I had bookmarked this (wrapper util, to make the “suckless” sv service manager less sucky)
            https://www.daveeddy.com/2018/09/20/vsv-void-service-manager/
            and, for logging: https://github.com/bahamas10/svlogger

            disclaimer:
            I’ve only read the docs/examples, am not a runit user, am not a fan.
            For me, the only interesting bit is its freestanding chpst utility.

            #55487
            Moderator
            christophe
              Helpful
              Up
              0
              ::

              Well. Thank you, skidoo. These look good.
              (Interestingly, my web search (duckduckgo) for those exact keywords doesn’t show those sites until much further down, and I didn’t look that far — but it does show this thread! The difference is incredible. I’m switching. )

              I’ll give these a go in a bit…

              • This reply was modified 2 years, 2 months ago by christophe. Reason: side-by-side comparison of the 2 web search engines

              confirmed antiX frugaler, since 2019

              #55509
              Anonymous
                Helpful
                Up
                0
                ::

                Graphical interface for sv – runit
                https://github.com/daltomi/xsv

                concise runit documentation @ voidlinux
                https://docs.voidlinux.org/config/services/user-services.html
                after reading the page, click the righthand navigation arrow to also read the “Per-User Services” page

                #55514
                Member
                ex_Koo
                  Helpful
                  Up
                  0
                  ::

                  The way I see your auto logging is just remember you need to start your desktop environment as well. What I do with ~/.xinitrc and adding exec i3.

                  I’ve never had anything auto login, I always like to login even from tty. I will be dumping all login managers as soon as I get my main system running and reinstalling hopefully this weekend. Which will also end my testing of antiX-21a as I won’t be reinstalling it.. And putting away my T430..

                  #55531
                  Moderator
                  christophe
                    Helpful
                    Up
                    0
                    ::

                    Koo – Yep. Starting X if logging in from tty1 (only) is better than the way I was doing it. Very good.

                    skidoo – This is much more complex than I had hoped, lol. The first step-by-step tutorial didn’t work. I’ll have to keep at it, but I think you have aimed me in the right direction. Thanks, again.

                    confirmed antiX frugaler, since 2019

                    #55541
                    Member
                    ex_Koo
                      Helpful
                      Up
                      0
                      ::

                      I tried to get it work also with 21a the file names seems to be different from void as they with antiX.

                      cp -R /etc/sv/agetty-tty1 /etc/sv/agetty-autologin-tty1 (antiX users getty-tty not agetty..) even tried after saving getty-tty1 then renaming agetty-autologin-tty1 to getty-tty1 (No worky)

                      rm /var/service/agetty-tty1 <<< same here antiX has no var/service file. So I made one /var/service
                      ln -s /etc/sv/agetty-autologin-tty1 /var/service <<< even after making a symlink ln -s /etc/sv/getty-autologin-tty1 /var/service (No worky)

                      But I did have one Win got rid of slim and now login with tty. πŸ™‚
                      Then adding below to my .profile auto start X works. πŸ™‚

                       # autologin on tty1
                       if [ -z "$DISPLAY" ] && [ "$(fgconsole)" -eq 1 ]; then
                       exec startx
                       fi

                      I have no intention of ever using auto login. Just wanted to play.

                      #55557
                      Moderator
                      christophe
                        Helpful
                        Up
                        0
                        ::

                        Right, Koo. I agree that it’s not so bad. X is loading automatically (and now the other VTs are available to me).
                        I can handle logging in once each day. πŸ™‚

                        Thanks, guys, for the help.

                        confirmed antiX frugaler, since 2019

                        #70254
                        Member
                        Vincent17
                          Helpful
                          Up
                          1
                          ::

                          I installed antix-21-runit_x64-core on an old Lenovo netbook. I was able to get autologin by editing the file /etc/sv/getty-tty1/run to read
                          exec chpst -P getty --autologin my_user_name 38400 tty1 linux
                          The idea came from here

                          @christophe
                          Thanks for your “just enough X” recipe . Without it, I would not have been brave enough to try a core install, and it was great fun. πŸ™‚ I had slightly different choice of software and display driver; apart from that it worked exactly as written.

                          • This reply was modified 1 year, 6 months ago by Vincent17.
                          • This reply was modified 1 year, 6 months ago by Vincent17. Reason: typo
                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.