Ok. I thought this was kernel's job. Is it really so? That would explain one oddity I have...pingtoo wrote:One of "init" duty for linux is reap zombie process.
Ok. I thought this was kernel's job. Is it really so? That would explain one oddity I have...pingtoo wrote:One of "init" duty for linux is reap zombie process.
Code: Select all
init=/sbin/openrc-init
-systemd -logind -elogind seatdI am NaN! I am a man!
Yes, it is init's job. See a simple example from openrc-init that catches SIGCHLD and reapsZucca wrote:Ok. I thought this was kernel's job. Is it really so? That would explain one oddity I have...pingtoo wrote:One of "init" duty for linux is reap zombie process.

Thanks NeddySeagoon. Because of your comment, I realized my mount steps where wrong at some points, so I updated like this:NeddySeagoon wrote:Fulgurance,
Lets back off a little.
You have a VM with a boot loader and a kernel and not much else.
What is in /dev is the VM root before anything is started.
You must have at least /dev/null and /dev/console or it all comes to a grinding halt.
The must be device special nodes too.
How doeswork?Code: Select all
mount --bind /run /run
--bind makes an already mounted filesystem visible somewhere else ... but you have said nothing about mounting run anywhere.
The kernel has mounted root, then its all up to you.
/run is usually tmpfs, so that it can be rw, even an a read only root fs.
I don't know what the --rbind mounts do either, as those filesystems are not mounted anywhere yet.
needs shared libraries.Code: Select all
#!/bin/bashStart off with a statically linked busyboxCode: Select all
$ lddtree /bin/bash /bin/bash (interpreter => /lib64/ld-linux-x86-64.so.2) libreadline.so.8 => /usr/lib64/libreadline.so.8 libtinfow.so.6 => /lib64/libtinfow.so.6 libtinfo.so.6 => /lib64/libtinfo.so.6 libc.so.6 => /lib64/libc.so.6
Where do you set $PATH ?
mount is actually /bin/mount, so it won't be found with an empty $PATH.
Hint: look at some initrd init scrips.
Code: Select all
#!/bin/bash
mount -o remount rw /
mount -o nosuid,noexec,nodev /proc
mount -o nosuid,noexec,nodev /sys
mount -o mode=0755,nosuid /dev
mount /run
mkdir -p /run/lock
chmod 1777 /run/lock
mkdir -p /dev/shm
mount -o nosuid,nodev /dev/shm
mkdir -pv /sys/fs/cgroup
mount -o nosuid,noexec,nodev /sys/fs/cgroup
ln -sf /proc/self/fd/0 /dev/stdin
ln -sf /proc/self/fd/1 /dev/stdout
ln -sf /proc/self/fd/2 /dev/stderr
ln -sfn /proc/self/fd /dev/fd
ln -sf /proc/kcore /dev/core
. /etc/profile
exec zeroinit
Code: Select all
openvt -f -w -c 1 -- /bin/sh -c "agetty - $TERM"

Code: Select all
$ cat /proc/sys/kernel/pty/nr
12
Output of ps axf after you log in and get a shell prompt?Fulgurance wrote:Because when I use the command openvt with agetty, I can login, but can't switch to any other virtual tty.
NeddySeagoon wrote:I'm not a witch, I'm a retired electronics engineer
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though


When you say "I [...] can't switch to any other virtual tty", does it mean that you just see an empty screen with a blinking cursor when you press CTRL + Alt + number? You have only one single agetty process for /dev/tty1, so not surprising if that's the case. Were you expecting to be greeted with a login prompt on every virtual terminal?Fulgurance wrote:https://i.ibb.co/gZZjXf0/Screenshot-20250115-130556.png
NeddySeagoon wrote:I'm not a witch, I'm a retired electronics engineer
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though

No, I mean even I press CTRL+ALT+number, I stay on the same screen. And when I loggin, it don't mention on which tty I am. It's like there only one tty.GDH-gentoo wrote:When you say "I [...] can't switch to any other virtual tty", does it mean that you just see an empty screen with a blinking cursor when you press CTRL + Alt + number? You have only one single agetty process for /dev/tty1, so not surprising if that's the case. Were you expecting to be greeted with a login prompt on every virtual terminal?
Also, Gentoo's configuration file for sys-apps/sysvinit just runs agetty directly, I don't think that it's necessary to go through openvt.


Code: Select all
def progressivePrint(text : String, speed = 20)
text.each_char do |character|
sleep(Time::Span.new(nanoseconds: speed*1000000))
print character
end
end