# systemd.target - Target unit configuration - man(5) - [phpMan]

[_SYSTEMD.TARGET_(5)](https://www.chedong.com/phpMan.php/man/SYSTEMD.TARGET/5/markdown)                          systemd.target                          [_SYSTEMD.TARGET_(5)](https://www.chedong.com/phpMan.php/man/SYSTEMD.TARGET/5/markdown)

## NAME
       systemd.target - Target unit configuration

## SYNOPSIS
       _target_.target

## DESCRIPTION
       A unit configuration file whose name ends in ".target" encodes information about a target
       unit of systemd. Target units are used to group units and to set synchronization points for
       ordering dependencies with other unit files.

       This unit type has no specific options. See [**systemd.unit**(5)](https://www.chedong.com/phpMan.php/man/systemd.unit/5/markdown) for the common options of all
       unit configuration files. The common configuration items are configured in the generic [Unit]
       and [Install] sections. A separate [Target] section does not exist, since no target-specific
       options may be configured.

       Target units do not offer any additional functionality on top of the generic functionality
       provided by units. They merely group units, allowing a single target name to be used in
       _Wants=_ and _Requires=_ settings to establish a dependency on a set of units defined by the
       target, and in _Before=_ and _After=_ settings to establish ordering. Targets establish
       standardized names for synchronization points during boot and shutdown. Importantly, see
       [**systemd.special**(7)](https://www.chedong.com/phpMan.php/man/systemd.special/7/markdown) for examples and descriptions of standard systemd targets.

       Target units provide a more flexible replacement for SysV runlevels in the classic SysV init
       system. For compatibility reasons special target units such as runlevel3.target exist which
       are used by the SysV runlevel compatibility code in systemd, see [**systemd.special**(7)](https://www.chedong.com/phpMan.php/man/systemd.special/7/markdown) for
       details.

       Note that a target unit file must not be empty, lest it be considered a masked unit. It is
       recommended to provide a [Unit] section which includes informative _Description=_ and
       _Documentation=_ options.

## AUTOMATIC DEPENDENCIES
### Implicit Dependencies
       There are no implicit dependencies for target units.

### Default Dependencies
       The following dependencies are added unless _DefaultDependencies=no_ is set:

       •   Target units will automatically complement all configured dependencies of type _Wants=_ or
           _Requires=_ with dependencies of type _After=_ unless _DefaultDependencies=no_ is set in the
           specified units.

           Note that the reverse is not true. For example, defining **Wants=that.target **in
           some.service will not automatically add the **After=that.target **ordering dependency for
           some.service. Instead, some.service should use the primary synchronization function of
           target type units, by setting a specific **After=that.target **or **Before=that.target **ordering
           dependency in its .service unit file.

       •   Target units automatically gain _Conflicts=_ and _Before=_ dependencies against
           shutdown.target.

## OPTIONS
       Target unit files may include [Unit] and [Install] sections, which are described in
       [**systemd.unit**(5)](https://www.chedong.com/phpMan.php/man/systemd.unit/5/markdown). No options specific to this file type are supported.

## EXAMPLE
### Example 1. Simple standalone target

           # emergency-net.target

           [Unit]
           Description=Emergency Mode with Networking
           Requires=emergency.target systemd-networkd.service
           After=emergency.target systemd-networkd.service
           AllowIsolate=yes

       When adding dependencies to other units, it's important to check if they set
       _DefaultDependencies=_. Service units, unless they set _DefaultDependencies=no_, automatically
       get a dependency on sysinit.target. In this case, both emergency.target and
       systemd-networkd.service have _DefaultDependencies=no_, so they are suitable for use in this
       target, and do not pull in sysinit.target.

       You can now switch into this emergency mode by running _systemctl_ _isolate_ _emergency-net.target_
       or by passing the option _systemd.unit=emergency-net.target_ on the kernel command line.

       Other units can have _WantedBy=emergency-net.target_ in the _[Install]_ section. After they are
       enabled using **systemctl enable**, they will be started before _emergency-net.target_ is started.
       It is also possible to add arbitrary units as dependencies of emergency.target without
       modifying them by using **systemctl add-wants**.

## SEE ALSO
       [**systemd**(1)](https://www.chedong.com/phpMan.php/man/systemd/1/markdown), [**systemctl**(1)](https://www.chedong.com/phpMan.php/man/systemctl/1/markdown), [**systemd.unit**(5)](https://www.chedong.com/phpMan.php/man/systemd.unit/5/markdown), [**systemd.special**(7)](https://www.chedong.com/phpMan.php/man/systemd.special/7/markdown), [**systemd.directives**(7)](https://www.chedong.com/phpMan.php/man/systemd.directives/7/markdown)

systemd 255                                                                        [_SYSTEMD.TARGET_(5)](https://www.chedong.com/phpMan.php/man/SYSTEMD.TARGET/5/markdown)
