Windows
Linux
Services & Processes
Services
Windows sc create / sc delete equivalent in Linux
Defines a new system service by creating a unit file, then enables and starts it.
Windows
→
sc create / sc delete
Linux equivalents
systemd unit files in /etc/systemd/system/
systemd unit files in /etc/systemd/system/
systemd unit files in /etc/systemd/system/
Overview
What this command does
Defines a new system service by creating a unit file, then enables and starts it.
Migration tip: Services are defined in plain text unit files. After creating or editing one, always run
systemctl daemon-reload before starting or enabling it.Practical tasks
Common use cases
Create a custom systemd service
Defines a new system service by creating a unit file, then enables and starts it.
/etc/systemd/system/
Location for custom service files
systemctl daemon-reload
Reload after creating/editing unit files
systemctl enable --now myapp
Enable and start immediately
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
sudo nano /etc/systemd/system/myapp.service
sudo systemctl daemon-reload
sudo systemctl enable --now myapp
Walkthrough
Examples with explanations
# Windows: sc create MySvc binpath= C:\app.exe
# Create unit file:
sudo nano /etc/systemd/system/myapp.service
[Unit]
Description=My Application
After=network.target
[Service]
ExecStart=/usr/bin/myapp
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now myapp
Reference
Common options and variations
| Command or option | Use |
|---|---|
/etc/systemd/system/ | Location for custom service files |
systemctl daemon-reload | Reload after creating/editing unit files |
systemctl enable --now myapp | Enable and start immediately |
systemctl cat myapp | View a service's unit file content |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
systemd commands are mostly distribution-neutral, but package names and service unit names can differ.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | apt + systemd | systemd unit files in /etc/systemd/system/ |
Same systemctl/journalctl syntax on systemd-based Debian and Ubuntu systems. |
| Fedora | dnf + systemd | systemd unit files in /etc/systemd/system/ |
Same command syntax; service names can differ by package. |
| Arch | pacman + systemd | systemd unit files in /etc/systemd/system/ |
Same command syntax; enable services explicitly after package installation. |
Keep learning