RHEL7: Boot systems into different targets manually.

Share this link

Note: This is an RHCSA 7 exam objective.

In the old days

Before Systemd, there were the following runlevels:

  • 1, single: maintenance level,
  • 2: level without network resources (NFS, etc),
  • 3: multi-user level without graphical interface,
  • 5: multi-user level with graphical interface.

Note: The default run level was set in the /etc/inittab file.

To get the current run level with the old way, type:

# runlevel

To change the current run level (where X is the run level), type:

# init X

Note: As seen before, levels 0 and 6 were respectively used for halting a system and for rebooting it.

Current State

With Systemd, new commands are available:

  • systemctl rescue: to move to single user mode/maintenance level with mounted local file systems,
  • systemctl emergency: to move to single user mode/maintenance with only /root mounted file system,
  • systemctl isolate multi-user.target: to move to multi-user level without graphical interface (equivalent to previous run level 3),
  • systemctl isolate graphical.target: to move to multi-user level with graphical interface (equivalent to previous run level 5),
  • systemctl set-default graphical.target: to set the default run level to multi-user graphical mode,
  • systemctl get-default: to get the default run level.

Additional Resources

Make sure you visit the Systemd page.

You can also watch Ralph Nyberg‘s video about Systemd targets (6min/2015).

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4.67 out of 5)
Loading...

Leave a Reply

3 Comments on "RHEL7: Boot systems into different targets manually."

Notify of
Sort by:   newest | oldest
salvador
Member
salvador

To boot into a systemd target from the grub menu, append to the kernel line for example:
systemd.unit=graphical.target

twostep
Member
twostep

Strange
In case of command “systemctl rescue” I get info:
“…Welcome to emergency mode! After logging in, type “journalctl -xb” to view…”
and all file systems are mounted.
Maybe the rescue mode is accessed only via rd.break parameter during boot?

wpDiscuz

RHCSA7: Task of the day

Allowed time: 5 minutes.
Create a user account named "tony" with password “redhat” and belonging to a secondary group called “team”.

RHCE7: Task of the day

Allowed time: 10 minutes.
Configure a httpd server that executes a Perl script in the /var/www/cgi-bin directory displaying "Hello!".

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...

Recent Comments