The officially official Devuan Forum!

You are not logged in.

#1 2022-12-25 15:12:53

selo384
Member
Registered: 2022-12-25
Posts: 2  

[SOLVED] autologin tty on runit

Hello i have a question what is the parameters to set the autologin on getty tty on runit init system?

Offline

#2 2022-12-25 15:31:44

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] autologin tty on runit

Edit /etc/inittab, here's the relevant section for my version in Alpine:

# Set up a couple of getty's
tty1::respawn:/sbin/agetty -a empty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
tty6::respawn:/sbin/getty 38400 tty6

^ So that runs agetty with the autologin option for my user on TTY1.

Obviously Devuan's file is different (I think it uses agetty by default) but the principle is the same.


Brianna Ghey — Rest In Power

Offline

#3 2022-12-25 15:41:05

selo384
Member
Registered: 2022-12-25
Posts: 2  

Re: [SOLVED] autologin tty on runit

I am running devuan chimaera and i dont have the "/etc/inittab" file i am using runit init system and i think its using getty by default.

Offline

#4 2022-12-25 15:51:33

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] autologin tty on runit

Oops, sorry, my mistake.

The relevant file is at /etc/sv/getty-tty?/run. I think. Give me a minute to check...

EDIT: yup, that seems to work:

#!/bin/sh -euC

# Disable service, if /dev/tty{N} does not exist. See #914788.
if ! test -c /dev/tty1 ; then
   rm /etc/service/getty-tty1
   exit 0
fi

pgrep -x getty -t tty1 && exit 163
pgrep -x agetty -t tty1 && exit 163
! type fgetty >/dev/null 2>&1 || exec chpst -P fgetty tty1
exec chpst -P agetty -a empty 38400 tty1 linux

Replace empty with the actual username though, ofc.

Last edited by Head_on_a_Stick (2022-12-25 16:05:38)


Brianna Ghey — Rest In Power

Offline

Board footer