Siduction Forum

Siduction Forum => Software - Support => Topic started by: Pergola on 2025/09/14, 19:27:11

Title: init 3 not working
Post by: Pergola on 2025/09/14, 19:27:11
When I type init 3, nothing happens. systemctl isolate multi-user.target brings me to console mode. Do you know this behavior?

(https://i.ibb.co/1GCNYLLr/2025-09-14-19-25.png) (https://ibb.co/v4NWCHH3)
Title: Re: init 3 not working
Post by: scholle1 on 2025/09/14, 20:20:05
Yes, here's the reason.

With systemd 258~rc1-1, support for user command for runlevel and runlevel targets (init 0 to init 6) has been removed.

The change is not user-friendly from systemd and is also irrelevant in terms of the code saved.
I now use a script called "onoff" in the /usr/sbin directory to replace the long systemd command.

#!/usr/bin/bash
#
# Name: /usr/sbin/onoff
#
# This script makes the functionality removed by systemd 258~rc1-1,
# init 0 to init 6, available again to the user in a running system.

case  "${1}" in
0)
systemctl poweroff
;;
1)
systemctl isolate emergency.target
;;
2)
systemctl isolate rescue.target
;;
3|4)
systemctl isolate multi-user.target
;;
5)
systemctl isolate graphical.target
;;
6)
systemctl reboot
;;
*)
echo "Error: >${1}< is not a valid option" && exit 1
;;
esac
exit 0


After that, you can use the command
onoff 6 to reboot, or onoff [2-5] to switch to another target, or onoff 0 to shutdown.
Title: Re: init 3 not working
Post by: scholle1 on 2025/09/14, 20:25:59
We will discuss within the team whether to include this script in our siduction-scripts package.
Title: Re: init 3 not working
Post by: Pergola on 2025/09/14, 22:03:04
Ahh... thank you for the explanation @scholle1!
Title: Re: init 3 not working
Post by: ro_sid on 2025/09/15, 09:46:12
Quote from: scholle1 on 2025/09/14, 20:25:59
We will discuss within the team whether to include this script in our siduction-scripts package.
Great idea  8)!
[Thanks to @scholle1: Simple, but very effective and nice to have!]
Title: Re: init 3 not working
Post by: dibl on 2025/09/15, 19:26:21
+1   :)
Title: Re: init 3 not working
Post by: reddark on 2025/09/16, 00:54:52
+ 1  ;)
Title: Re: init 3 not working
Post by: helux on 2025/09/16, 11:34:52
Kann man das script nicht "init" taufen? Dann ändert sich nichts.  8)
Title: Re: init 3 not working
Post by: deathwalker on 2025/09/19, 08:10:15
And what is the way of working for a Siduction update ?
In the manual is init 3 mentioned.
Title: Re: init 3 not working
Post by: scholle1 on 2025/09/19, 12:31:59
Quote from: helux on 2025/09/16, 11:34:52
Kann man das script nicht "init" taufen? Dann ändert sich nichts.  8)
Nein, leider nicht.
Das ist ja die verrückte Situation mit systemd. systemd benötigt selbst den Befehl init.
init ist ein Link auf ../lib/systemd/systemd.
$ readlink /usr/sbin/init                                                                                                             
../lib/systemd/systemd

Während des Bootvorgangs wird init mit PID 1 aufgerufen und an systemd weitergeleitet.
Im Code von systemd ist die Übersetzung der Initbefehle weiterhin vorhanden.
Das kannst du testen indem du an die Kernelbefehlszeile " 3" anhängst. Du landest dann auf TTY
und nicht in der graphischen Oberfläche.
Lediglich die Unterstützung des Aufrufs von init mit einer Benutzer PID wurde entfernt und
zusätzlich auch das Paket telinit.
Title: Re: init 3 not working
Post by: ro_sid on 2025/09/19, 14:08:02
QuoteLediglich die Unterstützung des Aufrufs von init mit einer Benutzer PID wurde entfernt und
zusätzlich auch das Paket telinit.
Ist das dann nicht auch die (Teil-)Lösung? telinit -> "neues" Skript mit wiedereingeführtem "telinit"; Handbuch ändern auf "telinit 3".
Title: Re: init 3 not working
Post by: scholle1 on 2025/09/19, 14:16:56
Quote from: deathwalker on 2025/09/19, 08:10:15
And what is the way of working for a Siduction update ?
In the manual is init 3 mentioned.
The online manual has just been updated.
https://manual.siduction.org/index_en.html (https://manual.siduction.org/index_en.html)
Title: Re: init 3 not working
Post by: scholle1 on 2025/09/19, 14:23:45
Quote from: ro_sid on 2025/09/19, 14:08:02
QuoteLediglich die Unterstützung des Aufrufs von init mit einer Benutzer PID wurde entfernt und
zusätzlich auch das Paket telinit.
Ist das dann nicht auch die (Teil-)Lösung? telinit -> "neues" Skript mit wiedereingeführtem "telinit"; Handbuch ändern auf "telinit 3".
telinit ist Teil von sysvinit-core und wegen Konflikten nicht mehr installierbar.
apt why-not sysvinit-core
sysvinit-core:amd64 is not selected for install because:
1. systemd-sysv:amd64 is selected for install
2. systemd-sysv:amd64 is available in version 258~rc4-1
3. sysvinit-core:amd64 Kollidiert mit systemd-sysv


-----------
edit 2025-09-22:
Befehl apt why-not sysvinit-core
statt apt-get -s install sysvinit-core
Title: Re: init 3 not working
Post by: DeepDayze on 2025/09/23, 22:43:12
@scholle1 thanks for your script as it's useful for translating the oldstyle SysV runlevels to the targets in systemd and making it easy as it was before to switch "runlevels" as now known as systemd targets (even though now the concept of runlevels are now all but deprecated).