How to start, stop, restart and list services in Debian Linux?

You require to be root to execute the following commands successfully.

su
 

Start a service

service {service name} start

прыклад

service sshd start
 

Stop a service

service {service name} stop

прыклад

service sshd stop
 

Restart a service

service {service name} restart

прыклад

service sshd stop
 

List all services

service --status-all

выхад

 [ - ]  alsa-utils
 [ - ]  anacron
 [ + ]  avahi-daemon
 [ - ]  bluetooth
 [ - ]  console-setup.sh
 [ + ]  крон
 [ + ]  dbus
 [ + ]  gdm3
 [ - ]  hwclock.sh
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ + ]  minissdpd
 [ + ]  network-manager
 [ - ]  networking
 [ - ]  pppd-dns
 [ + ]  procps
 [ + ]  rsyslog
 [ - ]  saned
 [ + ]  speech-dispatcher
 [ + ]  ssh
 [ + ]  udev
 [ + ]  unattended-upgrades
 [ - ]  x11-common

+ : Running services

– : Stopped services

Пакінуць каментар