equivalent systemd commands

About systemd and run levels…

to go to the different run levels, you type init 1, init 2, init 3, etc.

But my understanding is that these are being phased out as systemd is
taking over. In 12.3, we still have those init runlevel commands, but
perhaps in later versions they will be gone entirely?

So, I did some research, and I found that the equivalent systemd command
for “init 3” is


$ systemctl isolate multi-user.target

However, I could not figure out what the equivalents are for the other
run levels. Anyone know?


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

You have compatibility targets runlevel0.target, runlevel1.target etc through runlevel6.target. 0, 1, 3, 5 ,6 are mostly compatible with sysvinit. I do not think 2 or 4 will do anything useful (but I do not think they would under sysvinit either), at least by default, but they are there if you have set up a bunch of legacy services in sysvinit and want to continue to use them as separate “run level”.

Did you really ever use runlevel 2 on Linux in the past?

On 8/10/2013 11:11 PM, grglsn wrote:
> About systemd and run levels…
>
> to go to the different run levels, you type init 1, init 2, init 3, etc.
>
> But my understanding is that these are being phased out as systemd is
> taking over. In 12.3, we still have those init runlevel commands, but
> perhaps in later versions they will be gone entirely?
>
> So, I did some research, and I found that the equivalent systemd command
> for “init 3” is
>
>


> $ systemctl isolate multi-user.target
> 

>
> However, I could not figure out what the equivalents are for the other
> run levels. Anyone know?
>
grglsn;

init 0 <-> runlevel0.target or poweroff.target
init 1 <-> runlevel1.target or rescue.target
init 2 <-> runlevel2.target or multi-user.target
init 3 <-> runlevel3.target or multi-user.target
init 4 <-> runlevel4.target or multi-user.target
init 5 <-> runlevel5.target or graphical.target
init 6 <-> runlevel6.target or reboot.target

Notice that runlevel2,3 & 4 targets are all equivalent.

If you look in /usr/lib/systemd/system, you can see all the links.

P.V.
“We’re all in this together, I’m pulling for you” Red Green

On 08/11/2013 12:50 PM, PV wrote:
> On 8/10/2013 11:11 PM, grglsn wrote:
>> About systemd and run levels…
>>
>> to go to the different run levels, you type init 1, init 2, init 3, etc.
>>
>> But my understanding is that these are being phased out as systemd is
>> taking over. In 12.3, we still have those init runlevel commands, but
>> perhaps in later versions they will be gone entirely?
>>
>> So, I did some research, and I found that the equivalent systemd command
>> for “init 3” is
>>
>>


>> $ systemctl isolate multi-user.target
>> 

>>
>> However, I could not figure out what the equivalents are for the other
>> run levels. Anyone know?
>>
> grglsn;
>
> init 0 <-> runlevel0.target or poweroff.target
> init 1 <-> runlevel1.target or rescue.target
> init 2 <-> runlevel2.target or multi-user.target
> init 3 <-> runlevel3.target or multi-user.target
> init 4 <-> runlevel4.target or multi-user.target
> init 5 <-> runlevel5.target or graphical.target
> init 6 <-> runlevel6.target or reboot.target
>
> Notice that runlevel2,3 & 4 targets are all equivalent.
>
> If you look in /usr/lib/systemd/system, you can see all the links.

That’s great, thank so much.

Interesting that runlevels 2,3, and 4 are all the same. I have mostly
used runlevel 3 when I needed it. I have never used runlevel 4.

I looked in /usr/lib/systemd/system, and see the targets and links now.
Thanks again.


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

On 08/11/2013 12:46 PM, arvidjaar wrote:
>
> You have compatibility targets runlevel0.target, runlevel1.target etc
> through runlevel6.target. 0, 1, 3, 5 ,6 are mostly compatible with
> sysvinit. I do not think 2 or 4 will do anything useful (but I do not
> think they would under sysvinit either), at least by default, but they
> are there if you have set up a bunch of legacy services in sysvinit and
> want to continue to use them as separate “run level”.
>
> Did you really ever use runlevel 2 on Linux in the past?
>
>
Ok, thanks. I only used runlevel2 once, and I can’t remember what I
needed it for.


G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB

On 2013-08-12 01:02, grglsn wrote:
> On 08/11/2013 12:50 PM, PV wrote:

> Interesting that runlevels 2,3, and 4 are all the same. I have mostly
> used runlevel 3 when I needed it. I have never used runlevel 4.

Level 2 was multiuser with no network. It was used for maintenance,
making sure that only the person on the seat was working on the machine.
It was certainly different from levels 1 and 3.

Level 4 was reserved for definition by the administrator; thus it was
apparently unused by the distribution.

I’m surprised that they are all considered as equivalent by systemd.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

On 8/11/2013 6:02 PM, grglsn wrote:

<snip>
>
> That’s great, thank so much.
>
> Interesting that runlevels 2,3, and 4 are all the same. I have mostly
> used runlevel 3 when I needed it. I have never used runlevel 4.
>
> I looked in /usr/lib/systemd/system, and see the targets and links now.
> Thanks again.
>
The Fedora project wiki has a nice “cheatsheet” for SysVinit to Systemd that you might find useful:

https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet


P.V.
“We’re all in this together, I’m pulling for you” Red Green