You can also stop it with the =stop= subcommand (e.g., ~systemctl --user stop drive-backup.service~) and restart it with =restart= (e.g., ~systemctl --user restart drive-backup.service~).
If you want to enable it at startup, you can go with =enable= subcommand.
(To disable it, use the =disable= subcommand.)
#+begin_src shell :eval no
systemctl --user enable drive-backup.service
#+end_src
systemd will use the configuration file as-is by the time it is started/enabled.
Which means if the config file has been modified after activation, it will not take effect until you restarted it.
For this, you can reload the daemon with =daemon-reload= subcommand.
But for simpler cases, you can use the =reload= subcommand without fully restarting the daemon.
systemd also comes with a bootloader aptly named =systemd-boot= though it only supports UEFI-based firmware.
Just like GRUB, they can be configured through plain-text files.
For detailed information about the bootloader, see the manual page =systemd-boot.7=.
With a complete installation, the bootloader config folder may look like the following list.
#+begin_src
/boot/
`-- loader
|-- entries # (ref:loader-entries)
| `-- arch.conf
|-- loader.conf # (ref:loader-conf)
`-- random-seed
#+end_src
- [[(loader-entries)][=loader/entries/=]] is a directory containing all of the entries available to be booted.
- [[(loader-conf)][=loader.conf=]] contains the loader configuration.
Most Linux distros with systemd installed should have a sample config file somewhere. [fn:: In case of Arch Linux, it has an example file at =/usr/share/systemd/bootctl/=.]
As an example, we'll show what those look like.
=loader.conf= is the configuration for the boot loader including the timeout seconds among others.
Here is a sample of a bootloader configuration.
#+begin_src
default arch
timeout 4
#+end_src
In this config, this simply makes the =arch= loader entry to be default when no actions has occurred.
It will start loading it automatically after a timeout of 4 seconds.
The =arch= loader entry can be found at =${ESP}/loader/entries/arch.conf=.
The following code block shows what a loader entry looks like.
#+begin_src
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root="PARTUUID=${PARTUUID}"
#+end_src
You can customize and create extra entries for the same installation.
This is what roam:NixOS does with its package generations, letting the user to boot to a specific point in time from the boot loader.
Very useful for emergency boots in case the current generation breaks for whatever reason.
For complete details of the configuration file, you can see =loader.conf.5= manual page.
* Network manager configuration
:PROPERTIES:
:ID: e4dba4ef-71dd-4d30-9a2c-4ad97223510b
:END:
With a systemd-ful environment, you can run the network daemon (i.e., =systemd-networkd=).
Once enabled, you can run =networkctl= to list all of the network devices. [fn:: You can also run ~ip address~ for it.]
To configure network manager, you can create a network file in one of systemd unit file paths in the system.
Each of the device will be assigned an IP address.
You can either assign an IP address or dynamically assign them in some way.
One of the common ways to do dynamic IP addresses is installing a DHCP server (which is another thing to be configured).
Here's an example of configuring any wireless devices and assigning a dynamic IP addresses with [[https://wiki.archlinux.org/title/Network_configuration#DHCP][DHCP]].
#+begin_src
[Match]
Type=wlan
[Network]
DHCP=yes
IPv6PrivacyExtensions=yes
[DHCPv4]
RouteMetric=1024
[DHCPv6]
RouteMetric=1024
#+end_src
* DNS server configuration
While the network manager is enabled, you can access the internet.
But only with raw IP addresses (e.g., 1.1.1.1 from Cloudflare, 93.174.95.27 for Library Genesis). [fn:: You can find the IP addresses with DNS clients such as [[https://github.com/ogham/dog][dog]] or the [[https://nodejs.org/api/dns.html][DNS library from NodeJS]].]
Accessing the domain names as you would browse the web normally is an additional layer of the web.
To access a domain name, you need a DNS client that can resolve them.
While there are plenty of DNS resolvers, systemd has a component =systemd-resolved= which you can control with =resolvectl= binary.
systemd-resolved takes a configuration from =/etc/resolve.conf= which most third-party programs also relies on.