[Unit]
Description=My Web Application
After=network-online.target
Wants=network-online.target [Service]
Type=simple
ExecStart=/usr/bin/python3 /opt/myapp/server.py
Restart=on-failure
RestartSec=5
User=www-data [Install]
WantedBy=multi-user.target
[Unit]
Description=My Web Application
After=network-online.target
Wants=network-online.target [Service]
Type=simple
ExecStart=/usr/bin/python3 /opt/myapp/server.py
Restart=on-failure
RestartSec=5
User=www-data [Install]
WantedBy=multi-user.target
[Unit]
Description=My Web Application
After=network-online.target
Wants=network-online.target [Service]
Type=simple
ExecStart=/usr/bin/python3 /opt/myapp/server.py
Restart=on-failure
RestartSec=5
User=www-data [Install]
WantedBy=multi-user.target
mkdir -p ~/.config/systemd/user/
# Create unit file at ~/.config/systemd/user/myapp.service
systemctl --user daemon-reload
systemctl --user enable --now myapp.service
mkdir -p ~/.config/systemd/user/
# Create unit file at ~/.config/systemd/user/myapp.service
systemctl --user daemon-reload
systemctl --user enable --now myapp.service
mkdir -p ~/.config/systemd/user/
# Create unit file at ~/.config/systemd/user/myapp.service
systemctl --user daemon-reload
systemctl --user enable --now myapp.service
systemctl status myapp # Is it running?
systemctl restart myapp # Restart it
journalctl -u myapp -f # Follow logs
systemctl edit myapp # Override settings without modifying the unit file
systemctl list-timers # See scheduled tasks (systemd timers replace cron)
systemctl status myapp # Is it running?
systemctl restart myapp # Restart it
journalctl -u myapp -f # Follow logs
systemctl edit myapp # Override settings without modifying the unit file
systemctl list-timers # See scheduled tasks (systemd timers replace cron)
systemctl status myapp # Is it running?
systemctl restart myapp # Restart it
journalctl -u myapp -f # Follow logs
systemctl edit myapp # Override settings without modifying the unit file
systemctl list-timers # See scheduled tasks (systemd timers replace cron)
[Unit]
Description=My Application
After=network-online.target [Service]
Type=simple
ExecStart=/path/to/your/binary
Restart=always
RestartSec=5
Environment=NODE_ENV=production [Install]
WantedBy=default.target
[Unit]
Description=My Application
After=network-online.target [Service]
Type=simple
ExecStart=/path/to/your/binary
Restart=always
RestartSec=5
Environment=NODE_ENV=production [Install]
WantedBy=default.target
[Unit]
Description=My Application
After=network-online.target [Service]
Type=simple
ExecStart=/path/to/your/binary
Restart=always
RestartSec=5
Environment=NODE_ENV=production [Install]
WantedBy=default.target - The kernel starts PID 1 (/sbin/init)
- Init reads /etc/inittab and executes shell scripts in /etc/init.d/
- Each script starts one service, sequentially
- Scripts depend on other scripts through naming conventions (S01network, S02sshd, S03apache)
- Total boot time: 30-90 seconds on a modern machine - journald: Binary logging (replacing syslog)
- networkd: Network configuration
- resolved: DNS resolution
- timesyncd: NTP client
- logind: Session management
- timedated/localed/hostnamed: System configuration
- udevd: Device management
- nspawn: Container runtime
- homed: Home directory management - Every major distribution adopted it. Debian, Ubuntu, Fedora, RHEL, SUSE, Arch — all use systemd as default.
- Software assumes it. Docker, Kubernetes, most databases, most web servers — all ship systemd unit files. Not supporting systemd means maintaining your own service management.
- A generation of admins grew up with it. New Linux users learn systemctl first and might never encounter SysVinit. The knowledge base has shifted.
- It's genuinely good at its job. For all the controversy, systemd manages services reliably, boots fast, handles dependencies correctly, and provides excellent introspection tools.