Service Management
systemctl start [service]
- Starts a service immediately
- Does not enable at boot
systemctl stop [service]
- Stops running service
- Immediate effect only
systemctl restart [service]
- Stops and starts service
- Reloads configuration
systemctl reload [service]
- Reloads config without restart
- Not all services support this
Enable/Disable Services
systemctl enable [service]
- Enables service at boot
- Creates symlinks in targets
systemctl disable [service]
- Disables service at boot
- Removes symlinks
systemctl enable --now [service]
- Enables and starts immediately
Service Status
systemctl status [service]
- Shows detailed service status
- Recent log entries included
systemctl is-active [service]
- Returns active/inactive
- Exit code indicates status
systemctl is-enabled [service]
- Returns enabled/disabled
- Boot-time status check
List Services
systemctl list-units --type=service
- Shows all loaded services
- Current state displayed
systemctl list-unit-files --type=service
- Shows all service files
- Enabled/disabled status
Legacy Support
service [service] start
- Old init.d style command
- Still works on Debian
update-rc.d [service] enable
- Legacy enable command
- Use systemctl instead
Example Usage
|
|