<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.argentlinux.io/index.php?action=history&amp;feed=atom&amp;title=Argent_SystemD_Services</id>
	<title>Argent SystemD Services - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.argentlinux.io/index.php?action=history&amp;feed=atom&amp;title=Argent_SystemD_Services"/>
	<link rel="alternate" type="text/html" href="https://wiki.argentlinux.io/index.php?title=Argent_SystemD_Services&amp;action=history"/>
	<updated>2026-09-25T23:34:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.argentlinux.io/index.php?title=Argent_SystemD_Services&amp;diff=64&amp;oldid=prev</id>
		<title>Stefan: Argent SystemD management of services</title>
		<link rel="alternate" type="text/html" href="https://wiki.argentlinux.io/index.php?title=Argent_SystemD_Services&amp;diff=64&amp;oldid=prev"/>
		<updated>2026-09-25T20:55:57Z</updated>

		<summary type="html">&lt;p&gt;Argent SystemD management of services&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Systemd on Argent ===&lt;br /&gt;
&lt;br /&gt;
Argent runs on &amp;#039;&amp;#039;&amp;#039;systemd&amp;#039;&amp;#039;&amp;#039;, the Gentoo profile is &amp;lt;code&amp;gt;default/linux/amd64/23.0/desktop/plasma/systemd&amp;lt;/code&amp;gt;. There is no OpenRC: our make.conf disables the &amp;lt;code&amp;gt;openrc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sysvinit&amp;lt;/code&amp;gt; USE flags, and &amp;lt;code&amp;gt;/etc/init.d&amp;lt;/code&amp;gt; is not even installed (&amp;lt;code&amp;gt;INSTALL_MASK&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
So everything the Gentoo and systemd documentation says applies to Argent too:&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Systemd Gentoo wiki: systemd]&lt;br /&gt;
* the man pages that come with systemd, on your system: &amp;lt;code&amp;gt;man systemctl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;man journalctl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;man systemd.unit&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;man systemd.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;man systemd.timer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools you will use, all part of systemd:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;systemctl&amp;lt;/code&amp;gt;: start, stop, enable, disable and look at services&lt;br /&gt;
* &amp;lt;code&amp;gt;journalctl&amp;lt;/code&amp;gt;: read the logs&lt;br /&gt;
* &amp;lt;code&amp;gt;systemd-analyze&amp;lt;/code&amp;gt;: boot time, and what slows it down&lt;br /&gt;
* &amp;lt;code&amp;gt;coredumpctl&amp;lt;/code&amp;gt;: programs that crashed&lt;br /&gt;
* &amp;lt;code&amp;gt;timedatectl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hostnamectl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;localectl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;resolvectl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loginctl&amp;lt;/code&amp;gt;: time, hostname, keyboard and language, DNS, sessions&lt;br /&gt;
&lt;br /&gt;
This page explains what Argent runs, and how you manage it.&lt;br /&gt;
&lt;br /&gt;
== What runs on a fresh Argent ==&lt;br /&gt;
&lt;br /&gt;
=== System services ===&lt;br /&gt;
&lt;br /&gt;
These are enabled on an installed Argent:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Service !! What it does !! Package&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sddm.service&amp;lt;/code&amp;gt; || the login screen, also known as &amp;lt;code&amp;gt;display-manager.service&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;x11-misc/sddm&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;NetworkManager.service&amp;lt;/code&amp;gt; || the network (wired, wireless, VPN) || &amp;lt;code&amp;gt;net-misc/networkmanager&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;NetworkManager-dispatcher.service&amp;lt;/code&amp;gt; || runs scripts when the network changes || &amp;lt;code&amp;gt;net-misc/networkmanager&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;NetworkManager-wait-online.service&amp;lt;/code&amp;gt; || makes &amp;lt;code&amp;gt;network-online.target&amp;lt;/code&amp;gt; wait for the network || &amp;lt;code&amp;gt;net-misc/networkmanager&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ModemManager.service&amp;lt;/code&amp;gt; || mobile broadband modems || &amp;lt;code&amp;gt;net-misc/modemmanager&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;systemd-resolved.service&amp;lt;/code&amp;gt; || DNS, &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; points to it || &amp;lt;code&amp;gt;sys-apps/systemd&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;avahi-daemon.service&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;.socket&amp;lt;/code&amp;gt; || finds printers and other machines on your network (mDNS) || &amp;lt;code&amp;gt;net-dns/avahi&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;cups.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.socket&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;.path&amp;lt;/code&amp;gt; || printing || &amp;lt;code&amp;gt;net-print/cups&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;lvm2-monitor.service&amp;lt;/code&amp;gt; || LVM monitoring || &amp;lt;code&amp;gt;sys-fs/lvm2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;argent-config-vbox.service&amp;lt;/code&amp;gt; || loads the VirtualBox video driver before the login screen || &amp;lt;code&amp;gt;app-misc/argent-config-files&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;virtualbox-guest-additions.service&amp;lt;/code&amp;gt; || VirtualBox guest tools, it starts &amp;#039;&amp;#039;&amp;#039;only&amp;#039;&amp;#039;&amp;#039; inside VirtualBox || &amp;lt;code&amp;gt;app-emulation/virtualbox-guest-additions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;getty@tty1.service&amp;lt;/code&amp;gt; || the text console on tty1 || &amp;lt;code&amp;gt;sys-apps/systemd&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The default target is &amp;lt;code&amp;gt;graphical.target&amp;lt;/code&amp;gt;, so Argent boots straight to the login screen.&lt;br /&gt;
&lt;br /&gt;
Some services are not enabled, but still run: they are started on demand, by D-Bus, when a program asks for them. For example &amp;lt;code&amp;gt;polkit&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;udisks2&amp;lt;/code&amp;gt; (disks), &amp;lt;code&amp;gt;upower&amp;lt;/code&amp;gt; (battery) and &amp;lt;code&amp;gt;power-profiles-daemon&amp;lt;/code&amp;gt; (power profiles). Leave them alone.&lt;br /&gt;
&lt;br /&gt;
=== User services ===&lt;br /&gt;
&lt;br /&gt;
Every user who logs in gets their own systemd, with their own services. On Argent:&lt;br /&gt;
&lt;br /&gt;
* the sound: &amp;lt;code&amp;gt;pipewire.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pipewire-pulse.service&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wireplumber.service&amp;lt;/code&amp;gt;, enabled for each user. PipeWire replaces PulseAudio&lt;br /&gt;
* the whole Plasma desktop runs as user services: &amp;lt;code&amp;gt;plasma-plasmashell.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;plasma-kwin_wayland.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;plasma-powerdevil.service&amp;lt;/code&amp;gt; and so on&lt;br /&gt;
&lt;br /&gt;
To see them, as your user (not root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl --user list-units --type=service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Timers ===&lt;br /&gt;
&lt;br /&gt;
Argent has no cron daemon, systemd timers do that job. Out of the box there is only &amp;lt;code&amp;gt;systemd-tmpfiles-clean.timer&amp;lt;/code&amp;gt;, which cleans temporary files daily. To see all of them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl list-timers --all&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Argent&amp;#039;s own services ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;argent-config-vbox.service&amp;lt;/code&amp;gt;, from &amp;lt;code&amp;gt;app-misc/argent-config-files&amp;lt;/code&amp;gt;: runs &amp;lt;code&amp;gt;modprobe vboxvideo&amp;lt;/code&amp;gt; before &amp;lt;code&amp;gt;sddm&amp;lt;/code&amp;gt;, so the login screen works in VirtualBox&lt;br /&gt;
* &amp;lt;code&amp;gt;argentlive.service&amp;lt;/code&amp;gt;: only on the live ISO, it prepares the live session. It is not installed on your system&lt;br /&gt;
&lt;br /&gt;
The live ISO also enables &amp;lt;code&amp;gt;connman&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dkms&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dm-event&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lvm2-lvmetad&amp;lt;/code&amp;gt; when they are there, see the avasile page (&amp;lt;code&amp;gt;--makeiso&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Managing services ==&lt;br /&gt;
&lt;br /&gt;
Everything below needs root, except the &amp;lt;code&amp;gt;--user&amp;lt;/code&amp;gt; commands, which you run as your own user.&lt;br /&gt;
&lt;br /&gt;
To see how a service is doing, with its last log lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl status NetworkManager&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start, stop or restart it now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl start cups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl stop cups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart cups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start it at every boot (&amp;lt;code&amp;gt;enable&amp;lt;/code&amp;gt;), or not anymore (&amp;lt;code&amp;gt;disable&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;--now&amp;lt;/code&amp;gt; also starts or stops it right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl enable --now sshd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl disable --now sshd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make sure a service &amp;#039;&amp;#039;&amp;#039;never&amp;#039;&amp;#039;&amp;#039; starts, not even when something else asks for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl mask ModemManager&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl unmask ModemManager&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see what is enabled, and what failed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl list-unit-files --state=enabled&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl --failed&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For your own user services, add &amp;lt;code&amp;gt;--user&amp;lt;/code&amp;gt;, as your user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl --user restart pipewire&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing a package with a service ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;On Gentoo, and so on Argent, installing a package never enables its service.&amp;#039;&amp;#039;&amp;#039; That&amp;#039;s why &amp;lt;code&amp;gt;systemctl status&amp;lt;/code&amp;gt; shows &amp;lt;code&amp;gt;preset: disabled&amp;lt;/code&amp;gt; next to almost everything. You install, then you enable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;epkg install net-misc/openssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl enable --now sshd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same when you remove a package: disable its service first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl disable --now sshd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;epkg remove net-misc/openssh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Time synchronization ===&lt;br /&gt;
&lt;br /&gt;
Argent doesn&amp;#039;t enable time synchronization by default. &amp;lt;code&amp;gt;timedatectl&amp;lt;/code&amp;gt; shows you if your clock is synced:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To turn it on (it uses &amp;lt;code&amp;gt;systemd-timesyncd&amp;lt;/code&amp;gt;, already installed with systemd):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl set-ntp true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
&lt;br /&gt;
The logs are kept by &amp;lt;code&amp;gt;systemd-journald&amp;lt;/code&amp;gt;, in &amp;lt;code&amp;gt;/var/log/journal&amp;lt;/code&amp;gt;, so they survive a reboot.&lt;br /&gt;
&lt;br /&gt;
The logs of one service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;journalctl -u NetworkManager&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Follow them live:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;journalctl -u NetworkManager -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Everything since the last boot, or from the boot before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;journalctl -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;journalctl -b -1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only the errors since the last boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;journalctl -b -p err&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How much space the logs take, and how to shrink them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;journalctl --disk-usage&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;journalctl --vacuum-size=200M&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Where the unit files live ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! What is there !! Yours?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/lib/systemd/system/&amp;lt;/code&amp;gt; || system services installed by packages || &amp;#039;&amp;#039;&amp;#039;no&amp;#039;&amp;#039;&amp;#039;, overwritten at every upgrade&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt; || the enable links, your overrides, your own services || yes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/lib/systemd/user/&amp;lt;/code&amp;gt; || user services installed by packages || &amp;#039;&amp;#039;&amp;#039;no&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/etc/systemd/user/&amp;lt;/code&amp;gt; || user services for all users || yes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;~/.config/systemd/user/&amp;lt;/code&amp;gt; || user services only for you || yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
What is in &amp;lt;code&amp;gt;/etc&amp;lt;/code&amp;gt; wins over what is in &amp;lt;code&amp;gt;/usr/lib&amp;lt;/code&amp;gt;. So &amp;#039;&amp;#039;&amp;#039;never edit a file in &amp;lt;code&amp;gt;/usr/lib/systemd&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, the next &amp;lt;code&amp;gt;epkg upgrade&amp;lt;/code&amp;gt; puts it back. Override it in &amp;lt;code&amp;gt;/etc&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
After you change any unit file by hand, tell systemd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl daemon-reload&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changing an installed service ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl edit&amp;lt;/code&amp;gt; opens an editor with an empty override (a &amp;quot;drop-in&amp;quot;). You write only what you want to change, and it is saved in &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;service&amp;gt;.d/override.conf&amp;lt;/code&amp;gt;, so it survives upgrades:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl edit cups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, to restart cups whenever it crashes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
Restart=on-failure&lt;br /&gt;
RestartSec=5s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see the service together with your changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl cat cups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To throw your changes away and go back to the package&amp;#039;s version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl revert cups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding your own service ==&lt;br /&gt;
&lt;br /&gt;
Say you have a script, &amp;lt;code&amp;gt;/usr/local/bin/my-backup.sh&amp;lt;/code&amp;gt;, that you want systemd to run. Create &amp;lt;code&amp;gt;/etc/systemd/system/my-backup.service&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=My backup&lt;br /&gt;
After=network-online.target&lt;br /&gt;
Wants=network-online.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
ExecStart=/usr/local/bin/my-backup.sh&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl daemon-reload&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl enable --now my-backup.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For something that keeps running (a server, a daemon), use &amp;lt;code&amp;gt;Type=simple&amp;lt;/code&amp;gt; and add &amp;lt;code&amp;gt;Restart=on-failure&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;man systemd.service&amp;lt;/code&amp;gt; has all the options.&lt;br /&gt;
&lt;br /&gt;
=== Running it on a schedule ===&lt;br /&gt;
&lt;br /&gt;
Instead of cron, a timer with the same name as the service. Create &amp;lt;code&amp;gt;/etc/systemd/system/my-backup.timer&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=My backup, every night&lt;br /&gt;
&lt;br /&gt;
[Timer]&lt;br /&gt;
OnCalendar=*-*-* 02:00:00&lt;br /&gt;
Persistent=true&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=timers.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Persistent=true&amp;lt;/code&amp;gt; means that if the machine was off at 02:00, the backup runs at the next boot. Then enable the timer, &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; the service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl daemon-reload&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl disable my-backup.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl enable --now my-backup.timer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl list-timers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A service for your user only ===&lt;br /&gt;
&lt;br /&gt;
The same, but in &amp;lt;code&amp;gt;~/.config/systemd/user/&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;WantedBy=default.target&amp;lt;/code&amp;gt;, and with &amp;lt;code&amp;gt;--user&amp;lt;/code&amp;gt;, as your user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl --user daemon-reload&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl --user enable --now my-sync.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It starts when you log in, and stops when you log out.&lt;br /&gt;
&lt;br /&gt;
== Configuring systemd itself ==&lt;br /&gt;
&lt;br /&gt;
systemd&amp;#039;s own settings are in &amp;lt;code&amp;gt;/etc/systemd/&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;journald.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;logind.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;resolved.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;system.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sleep.conf&amp;lt;/code&amp;gt;, ... On Argent they are all left at the systemd defaults.&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t edit those files, add a drop-in next to them. For example, to keep the logs under 500 MB, create &amp;lt;code&amp;gt;/etc/systemd/journald.conf.d/100-my.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Journal]&lt;br /&gt;
SystemMaxUse=500M&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart systemd-journald&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every file has its man page: &amp;lt;code&amp;gt;man journald.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;man logind.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;man resolved.conf&amp;lt;/code&amp;gt;, ...&lt;br /&gt;
&lt;br /&gt;
== When something goes wrong ==&lt;br /&gt;
&lt;br /&gt;
What failed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl --failed&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Why it failed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl status &amp;lt;service&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;journalctl -u &amp;lt;service&amp;gt; -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What crashed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;coredumpctl list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;coredumpctl info &amp;lt;PID&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Why the boot is slow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemd-analyze&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemd-analyze blame&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemd-analyze critical-chain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you ask for help on our channels, bring the output of &amp;lt;code&amp;gt;systemctl --failed&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;journalctl -b -p err&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Stefan</name></author>
	</entry>
</feed>