Service Management

Systemctl and service management commands for controlling daemons, enabling boot services, and checking status

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Start and enable nginx
systemctl enable --now nginx

# Check status
systemctl status nginx

# Restart after config change
systemctl restart nginx

# View all running services
systemctl list-units --type=service --state=running