Linux run levels

I have failed last 4 task because of not reading the task clearly. But this time i read my times .I changed the vi /etc/inittab in all the 3 app server so that on next boot it will be graphical . But task is failed.

Kindly help

Hi team,

please update the status

This might help with this task.

With the introduction of systemd , the file /etc/inittab is no longer used to set the default run level: the new /etc/inittab file became nothing more than a readme containing a short (and useful) guide to the new target-based system:

# inittab is no longer used when using systemd.

# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.

# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target

#

# systemd uses 'targets' instead of runlevels. By default, there are two main targets:

#

# multi-user.target: analogous to runlevel 3

# graphical.target: analogous to runlevel 5

#

# To view current default target, run:

# systemctl get-default

#

# To set a default target, run:

# systemctl set-default TARGET.target
1 Like

have you did entry “id:5:initdefault:” in /etc/inittab ?

I did below

systemctl set-default graphical.target

1 Like

that’s not enough. You have just set it up running time default value. You have to entry “id:5:initdefault:” in /etc/inittab also. I guess may be this is also a option systemctl start graphical.target && systemctl enable graphical.target .

1 Like

but it was mentioned in the task that it should on next boot of server

Hi @dineshtobe

In CentOS7 / RHEL7 systemd uses targets instead of run-levels. /etc/inittab is no more used by systemd to change the run levels. While reviewing your answer I just realized you reverted the run level to multi-user.target maybe mistakenly hence your answer was marked as failed.

Hi @Inderpreet,

Yes you are write , i reverted configuration because in task it was mentioned GUI should be on next boot…

“start”, “enable” and “status” are not just options, they’re requirements. Don’t miss these commands. Good luck guys!

2 Likes

These are 5 steps to successfully complete the task
1.get THE default
2.SET the -default run-level
verify
3.start TARGET
4.ENABLE TARGETS >>>for system reboot
5.check status
Good luck!

2 Likes

nicely said @jcorexx

To verify, run the cmd below

systemctl status graphical.target always make sure to run systemctl list-units --t target and see if the unit is active or load… systemctl status does the job as well!

I performed the task same way on all 3 app server but got failure for only App Server 1. Screenshot from app server 1.

CentOS7 / RHEL7 systemd uses targets instead of run-levels. /etc/inittab is no more used by systemd to change the run levels. While reviewing your answer I just realized you reverted the run level to multi-user.target maybe mistakenly hence your answer was marked as failed.

@smartclick

@player001 Thanks for your response mate. As shared i followed same step on all 3 app servers exactly same. Any reason why its considered failed only on app server 1 ?.

Validation procedure proceed one by one server so it’s failed to validate in app server 1 so procedure not proceed ahead and stopped at app server 1 and result shown in your task browser.

1 Like

Need to start and enable the service otherwise it will show task failed. Beginners can see this tutorial: Linux Run Levels Kodekloud Solution

For Tutorial/Solution - Content made for sole reason to help the community.

I am getting error Failed to set default target: The name org.freedesktop.PolicyKit1 was not provided by any .service files.
Can anyone help me…

Two commands
systemctl enable graphical.target
systemctl set-default graphical.target
Then you can check status
systemctl get-default