Ziofester76
Posts: 1
Joined: Sun Jun 21, 2020 2:36 pm

Runlevel

Sun Jun 21, 2020 2:43 pm

Hello, i need to change the default runelvel in raspberry pi 2.
how can i do?

User avatar
jahboater
Posts: 6270
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Runlevel

Sun Jun 21, 2020 6:56 pm

You need to give more info about what OS you are running etc.

Assuming you are using the official Raspberry Pi OS (formerly Raspbian) then I suggest reading:-

"man init" or "man systemd"
Pi4 8GB running PIOS64 Lite

fbe
Posts: 648
Joined: Thu Aug 17, 2017 9:08 pm

Re: Runlevel

Sun Jun 21, 2020 7:04 pm

You very likely don't need to change the default runlevel. Please explain what you actually want to achieve.

User avatar
DougieLawson
Posts: 40138
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Runlevel

Sun Jun 21, 2020 7:23 pm

Ziofester76 wrote:
Sun Jun 21, 2020 2:43 pm
Hello, i need to change the default runelvel in raspberry pi 2.
how can i do?
You'd need to revert to Jessie. sysvinit was removed in Stretch. There's no such thing with systemd. Stop trying to follow out of data instructions. Reject anything you find on the internet that was published more than a year ago (when Buster came out).
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
jahboater
Posts: 6270
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Runlevel

Sun Jun 21, 2020 7:59 pm

init/telinit still work (init 6 will reboot a Pi for example), but as Dougie says, its legacy.
For compatibility with SysV, if systemd is called as init and a PID that is not 1, it will
execute telinit and pass all command line arguments unmodified. That means init and
telinit are mostly equivalent when invoked from normal login sessions. See telinit(8) for
more information.
You can still do init 2 to set run level 2, but it wont do what you expect.
Its equivalent to "systemctl isolate runlevel2.target" whatever that is.
See "man 8 telinit".
Pi4 8GB running PIOS64 Lite

22over7
Posts: 63
Joined: Sat Jun 13, 2020 8:39 pm

Re: Runlevel

Tue Jun 23, 2020 5:01 am

I'm new to Pi (still waiting for my Pi4) and I have a question related to runlevel: For my usage scenario, half of the time I want to access the graphics desktop, and the other half of the time I will access it headless and use x11 forward to run a couple of programs. If I install the raspberry OS desktop version, how should I change the run level (or whatever the systemd equivalence) so that Pi4 starts from text mode, and then I can run startx as needed?

Alternatively, should I install raspberry OS lite and then manually install the desktop as explained in
viewtopic.php?t=133691
but then I will miss various packages... ?

Thanks!

W. H. Heydt
Posts: 13602
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Runlevel

Tue Jun 23, 2020 5:22 am

22over7 wrote:
Tue Jun 23, 2020 5:01 am
I'm new to Pi (still waiting for my Pi4) and I have a question related to runlevel: For my usage scenario, half of the time I want to access the graphics desktop, and the other half of the time I will access it headless and use x11 forward to run a couple of programs. If I install the raspberry OS desktop version, how should I change the run level (or whatever the systemd equivalence) so that Pi4 starts from text mode, and then I can run startx as needed?

Alternatively, should I install raspberry OS lite and then manually install the desktop as explained in
viewtopic.php?t=133691
but then I will miss various packages... ?

Thanks!
You can install the full RPiOS and then configure it to boot to the CLI. That will allow you start Xwindows when you want to (or not).

22over7
Posts: 63
Joined: Sat Jun 13, 2020 8:39 pm

Re: Runlevel

Tue Jun 23, 2020 5:55 am

W. H. Heydt wrote:
Tue Jun 23, 2020 5:22 am
You can install the full RPiOS and then configure it to boot to the CLI. That will allow you start Xwindows when you want to (or not).
Aaah -- good old rasp-config again. Thanks!

Return to “General discussion”