- The `Unit` section provides metadata about the unit including which `systemd`
dependencies it has
-`Service` constitutes the main specification for the unit
-`Install` is the call to set the dependencies running before the `Service`
functions are accessible.
## systemd operations: systemctl
The `systemctl` command is the chief way of interacting with `systemd`. You use
it to activate and deactivate services, list their status, reload the
configuration and so.
### View the dependency graph
`systemctl status` by itself will print a long list of units grouped by their
dependency relations. It will also provide some metadata about the current
systemd boot context.
### Viewing active units
Below I have listed the running units pertaining to bluetooth:
```
$ systemctl list-units | grep bluetooth
sys-devices-pci0000:00-0000:00:14.0-usb3-3\x2d10-3\x2d10:1.0-bluetooth-hci0-hci0:3585.device loaded active plugged /sys/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10:1.0/bluetooth/hci0/hci0:3585
sys-devices-pci0000:00-0000:00:14.0-usb3-3\x2d10-3\x2d10:1.0-bluetooth-hci0.device loaded active plugged /sys/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10:1.0/bluetooth/hci0
sys-subsystem-bluetooth-devices-hci0.device loaded active plugged /sys/subsystem/bluetooth/devices/hci0
sys-subsystem-bluetooth-devices-hci0:3585.device loaded active plugged /sys/subsystem/bluetooth/devices/hci0:3585
bluetooth.service loaded active running Bluetooth service
bluetooth.target loaded active active Bluetooth Support
```
### List jobs
Requests to activate, reactivate and restart units are called **jobs** in
`systemd`. They can be thought of as unit state changes. Current jobs can be
listed with `systemctl list-jobs`.
This will most likely return `No jobs running` if the computer has been running
for a while. Most jobs execute at boot.
### Enable/disable, start/stop units
If a unit has dependencies it is necessary to _enable_ it before starting it.
This installs the dependencies.
```bash
systemctl enable mongodb.service
Created symlink /etc/systemd/system/multi-user.target.wants/mongodb.service → /usr/lib/systemd/system/mongodb.service.
```
Then we can start:
```
systemctl start mongodb.service
```
To stop the service:
```
systemctl stop mongodb.service
```
After this we should disable it, in order to remove any symbolic links it has
created on the system as part of the install process: