What does WantedBy multi-user target do?

What does WantedBy multi-user target do?

multi-user. target normally defines a system state where all network services are started up and the system will accept logins, but a local GUI is not started. This is the typical default system state for server systems, which might be rack-mounted headless systems in a remote server room.

What is systemd multi-user target?

multi-user. target is basically the closest equivalent of classic SysVinit runlevel 3 that systemd has. When a systemd system boots up, systemd is trying to make the system state match the state specified by default. target – which is usually an alias for either graphical. target is another possible alias for default.

What is systemd WantedBy?

WantedBy= : The WantedBy= directive is the most common way to specify how a unit should be enabled. This directive allows you to specify a dependency relationship in a similar way to the Wants= directive does in the [Unit] section.

How do I change my multi-user target?

How to Change Runlevels (targets) in SystemD

  1. Run level 0 is matched by poweroff. target (and runlevel0.
  2. Run level 1 is matched by rescue. target (and runlevel1.
  3. Run level 3 is emulated by multi-user.
  4. Run level 5 is emulated by graphical.
  5. Run level 6 is emulated by reboot.
  6. Emergency is matched by emergency.

Why do most systemd examples contain wantedby = multi-user?

If you install pure systemd from the source, the “default target” that it boots to is graphical.target. Starting graphical.target starts multi-user.target, plus whatever unit (s) are required to provide a graphical user interface. This extra complexity was arranged in an attempt to emulate legacy “runlevels”.

What does multi-user.target mean in systemd?

This is the dependencies handling mechanism in systemd. multi-user.target is the alternative for runlevel 3 in systemV world. That said, reaching multi-user.target includes starting the “Confluent ZooKeeper” service. Probably that’s what you need indeed. multi-user.target means that the systemd-service will start when the system reach runlevel 2.

What’s the difference between after and wantedby in systemd?

The service (or whatever you are defining) will run after the unit listed in After. Similarly, WantedBy seems pretty straight forward. You are defining that the unit you list has a Want to your service. So for a target like multi-user or graphical, your unit should be run in order for systemd to consider that target reached.

Which is the superset of the multi-user?

Normally it’s defined as a superset of the multi-user.target: it includes everything the multi-user.target does, plus the activation of a local GUI login. So kind of like runlevel 5 in classic SysVinit.