Sobes.tech
Junior — Middle

What methods are used to start and configure services in the Ubuntu operating system?

sobes.tech AI

Answer from AI

In Ubuntu, systemd is usually used to manage services.

Main commands:

  • systemctl start <service> — start a service.
  • systemctl stop <service> — stop a service.
  • systemctl restart <service> — restart a service.
  • systemctl enable <service> — enable auto-start on boot.
  • systemctl disable <service> — disable auto-start.
  • systemctl status <service> — check service status.

To configure services, edit their unit files, usually located in /etc/systemd/system/ or /lib/systemd/system/.

Example to start and enable nginx:

sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx

Earlier, Ubuntu used Upstart or init.d scripts, but now systemd is standard.