Skip to main content

debian alt in init : sysv,openrc,runit,systemd

 

https://wiki.debian.org/Init http://www.yolinux.com/TUTORIALS/LinuxTutorialInitProcess.html

chroot mode / init=/bin/sh apt --download-only install sysvinit-core libpam-elogind

libelogind0 , libsystemd0 will pull systemd/elogind when necessary so you can swap one for other depending on need

sysvinit-core has init in /sbin/init /usr/sbin/init is symlinked to /lib/systemd/systemd by systemd-sysv package also provides /usr/sbin/halt,init,poweroff,reboot,runlevel,shutdown,telinit dracut has /init as systemd

init-system-helpers(essential)
/usr/bin/deb-systemd-helper,deb-systemd-invoke /usr/sbin/invoke-rc.d,service,update-rc.d sudo apt install initscripts

sysvinit-core /usr/sbin/halt,init,poweroff,reboot,runlevel,shutdown,telinit /usr/share/sysvinit/inittab

sysvinit-utils(essential) /usr/bin/pidof /usr/lib/init/init-d-script /usr/lib/init/vars.sh /usr/lib/lsb/init-functions /usr/lib/lsb/init-functions.d/00-verbose /usr/sbin/fstab-decode /usr/sbin/killall5

reinstall udev without udev needs manually loading driver in /etc/modules , find /proc/modules depmod -a generates /lib/modules/kernel-version/modules.dep

https://packages.debian.org/stable/all/orphan-sysvinit-scripts/filelist

/etc/inittab

syntax : id:runlevels:action:process id: A unique identifier for each entry (up to four characters). runlevels: Specifies the runlevels at which this entry should be executed. Each runlevel is a single digit, so multiple runlevels can be specified without separators (e.g., 123). action: Defines the action that init should take. Common actions include:

respawn: Restart the process if it terminates.
wait: Start the process once when entering the specified runlevel and wait for it to finish.
once: Start the process once when entering the specified runlevel without waiting.
sysinit: Run the process during system initialization.
initdefault: default init script to run
ctrlaltdel: Execute the process when Ctrl+Alt+Del is pressed.
powerfail: Run the process if a power failure is detected (if supported).

process: The command to execute, which can be a path to a program or a script.

runlevels

Runlevel 0 is halt.

Runlevel 1 is single-user.

Runlevels 2-5 are multi-user.

Runlevel 6 is reboot.

debian has runkevel in folder /etc/rc0.d,rc1.d....rc6.d,rcS.d

scripts in runlevels are renamed SXX or KXX to enable or disable

example : id:2:initdefault:

Boot-time system configuration/initialization script.

This is run first except when booting in emergency (-b) mode.

si::sysinit:/etc/init.d/rcS empty runlevel here means that the process defined by this entry runs at the system initialization stage before the runlevel is set.

~~:S:wait:/sbin/sulogin --force

l0:0:wait:/etc/init.d/rc 0

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

ps aux | head

runit sudo apt install runit-systemd runit runit-run elogind libpam-elogind orphan-sysvinit-scripts systemctl procps

https://lecorbeausvault.wordpress.com/2022/02/07/debian-switching-init-system-easily-openrc-sysvinit-runit/

Comments

Popular posts from this blog

xdm linux merge incomplete download parts

 some download stuck at 99.99% , merge them regardless got to ~/.xdm-app-data/Data/*.state cat dec.py import os import re # Define the pattern to extract the segment number pattern = re.compile(r'seg-(\d+)-v1-a1\.ts') # Get the current working directory current_directory = os.getcwd() # List to hold tuples of (segment_number, filename) files_with_segments = [] # Iterate through files in the current directory for filename in os.listdir(current_directory): match = pattern.search(filename) if match: # Extract the segment number as an integer segment_number = int(match.group(1)) # Add the tuple (segment_number, filename) to the list files_with_segments.append((segment_number, filename)) # Sort the list by the segment number (numerical sort) files_with_segments.sort(key=lambda x: x[0]) # Open the filelist.txt for writing with open('filelist.txt', 'w') as filelist: for _, filename in files_with_segments: file...

kde on debian

https://wiki.debian.org/KDE sudo apt install   xserver-xorg-input-libinput xserver-xorg-video-intel  sudo apt install plasma-desktop plasma-workspace-wayland  sddm  issue  file:///usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/ui/Kickoff.qml:157:34: Type FullRepresentat ion unavailable file:///usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/ui/FullRepresentation.qml:80:22: Type Norma lPage unavailable file:///usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/ui/NormalPage.qml:43:13: Type Footer unavai lable file:///usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/ui/Footer.qml:155:5: Type LeaveButtons unav ailable file:///usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/ui/LeaveButtons.qml:14:1: module "org.kde.k itemmodels" is not installed # upower , it is installed by powerdevil though sudo apt install kde-config-gtk-style  kde-config-gtk-style-preview   breeze-gtk-theme  sudo apt i...

rsa encryption

 choose two large  prime number p (prime 1) and q (prime 2)   n = p x q , where n is called the modulus for encryption and decryption   φ = ( p - 1) x ( q -1) is called Euler's totient function for n= pq For a given positive integer n, Euler's totient function ϕ(n) is defined as the number of positive integers less than or equal to n that are coprime (i.e., share no common factors) with n. ϕ( n ) = n ∏ p ∣ n ( 1 − 1 p )     \phi(n) = n \prod_{p \mid n} \left(1 - \frac{1}{p}\right)   p ∣ n means that p p divides n , and is a prime factor greater than 1  i  n    example , n=2*3=6 with factors f=1 , 2 , 3 , 4 , 5,6 factors Two numbers are coprime if their greatest common divisor (GCD) is 1 here find gcd(f,n)=1  only 1 and 5 are coprime with 6  φ =1*2 =2   choose e less  than φ , such that  e is co prime with φ , ie  e has no common factor with φ except 1 mathematically : gcd ( e , φ ...