База знаний по Open Source
Авторизация
Поиск по базе знаний

Для работы с сервисами в Ubuntu 16.04 в основном рекомендуется использовать команду systemctl. Для того, чтобы посмотреть все загруженные/активные сервисы набираем:

$ sudo systemctl -t service
UNIT                               LOAD   ACTIVE SUB     DESCRIPTION
accounts-daemon.service            loaded active running Accounts Service
acpid.service                      loaded active running ACPI event daemon
apparmor.service                   loaded active exited  LSB: AppArmor initialization
apport.service                     loaded active exited  LSB: automatic crash report generation
atd.service                        loaded active running Deferred execution scheduler
cgmanager.service                  loaded active running Cgroup management daemon
console-setup.service              loaded active exited  Set console font and keymap
cron.service                       loaded active running Regular background program processing daemon
dbus.service                       loaded active running D-Bus System Message Bus
ebtables.service                   loaded active exited  LSB: ebtables ruleset management
getty@tty1.service                 loaded active running Getty on tty1
grub-common.service                loaded active exited  LSB: Record successful boot for GRUB
.
.
.
systemd-logind.service             loaded active running Login Service
systemd-modules-load.service       loaded active exited  Load Kernel Modules
systemd-random-seed.service        loaded active exited  Load/Save Random Seed
systemd-remount-fs.service         loaded active exited  Remount Root and Kernel File Systems
systemd-sysctl.service             loaded active exited  Apply Kernel Variables
systemd-timesyncd.service          loaded active running Network Time Synchronization
systemd-tmpfiles-setup-dev.service loaded active exited  Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service     loaded active exited  Create Volatile Files and Directories
systemd-udev-settle.service        loaded active exited  udev Wait for Complete Device Initialization
systemd-udev-trigger.service       loaded active exited  udev Coldplug all Devices
systemd-udevd.service              loaded active running udev Kernel Device Manager
systemd-update-utmp.service        loaded active exited  Update UTMP about System Boot/Shutdown
systemd-user-sessions.service      loaded active exited  Permit User Sessions
ufw.service                        loaded active exited  Uncomplicated firewall
user@1000.service                  loaded active running User Manager for UID 1000
virtlogd.service                   loaded active running Virtual machine log manager
zed.service                        loaded active running ZFS Event Daemon (zed)
zfs-import-cache.service           loaded active exited  Import ZFS pools by cache file
zfs-mount.service                  loaded active exited  Mount ZFS filesystems
zfs-share.service                  loaded active exited  LSB: Network share OpenZFS datasets.

LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.

64 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

Для того, чтобы посмотреть ВСЕ сервисы, установленные в системе:

$ sudo systemctl list-unit-files -t service
UNIT FILE                                  STATE   
accounts-daemon.service                    enabled 
acpid.service                              disabled
apport-forward@.service                    static  
apt-daily.service                          static  
atd.service                                enabled 
autovt@.service                            enabled 
bootlogd.service                           masked  
bootlogs.service                           masked  
bootmisc.service                           masked  
cgmanager.service                          enabled 
cgproxy.service                            enabled 
checkfs.service                            masked  
checkroot-bootclean.service                masked  
checkroot.service                          masked  
colord.service                             static  
console-getty.service                      disabled
console-setup.service                      static  
console-shell.service                      disabled
container-getty@.service                   static  
cron.service                               enabled 
cryptdisks-early.service                   masked  
cryptdisks.service                         masked  
dbus-org.freedesktop.hostname1.service     static  
dbus-org.freedesktop.locale1.service       static  
dbus-org.freedesktop.login1.service        static  
dbus-org.freedesktop.network1.service      disabled
dbus-org.freedesktop.resolve1.service      disabled
dbus-org.freedesktop.timedate1.service     static  
dbus.service                               static  
debug-shell.service                        disabled
dm-event.service                           disabled
emergency.service                          static  
friendly-recovery.service                  enabled 
fuse.service                               masked  
getty-static.service                       static  
getty@.service                             enabled 
.
.
.
systemd-reboot.service                     static  
systemd-remount-fs.service                 static  
systemd-resolved.service                   disabled
systemd-rfkill.service                     static  
systemd-suspend.service                    static  
systemd-sysctl.service                     static  
systemd-timedated.service                  static  
systemd-timesyncd.service                  enabled 
systemd-tmpfiles-clean.service             static  
systemd-tmpfiles-setup-dev.service         static  
systemd-tmpfiles-setup.service             static  
systemd-udev-settle.service                static  
systemd-udev-trigger.service               static  
systemd-udevd.service                      static  
systemd-update-utmp-runlevel.service       static  
systemd-update-utmp.service                static  
systemd-user-sessions.service              static  
udev.service                               static  
ufw.service                                enabled 
umountfs.service                           masked  
umountnfs.service                          masked  
umountroot.service                         masked  
unattended-upgrades.service                enabled 
urandom.service                            static  
ureadahead-stop.service                    static  
ureadahead.service                         enabled 
user@.service                              static  
uuidd.service                              indirect
virtlockd.service                          indirect
virtlogd.service                           indirect
x11-common.service                         masked  
zed.service                                static  
zfs-import-cache.service                   static  
zfs-import-scan.service                    static  
zfs-mount.service                          static  

184 unit files listed.

Чтобы остановить или сделать сервис НЕ автозагружаемым используем (на примере apparmor):

$ sudo systemctl stop apparmor
$ sudo systemctl disable apparmor