2018年10月30日 星期二

[linux] 怎麼關閉 runlevel 重啟後自動開啟的服務 how to disable service when reboot

[linux] 怎麼關閉 runlevel 重啟後自動開啟的服務 how to disable service when reboot

systemctl - Control the systemd system and service manager

   Unit File Commands
       list-unit-files [PATTERN...]
           List installed unit files and their enablement state (as reported by is-enabled). If one or more PATTERNs are specified, only units whose filename (just the last
           component of the path) matches one of them are shown.


# systemctl list-unit-files

redis-server.service                       enabled
redis.service                              enabled

systemctl disable redis-server.service redis.service
Synchronizing state of redis-server.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install disable redis-server
insserv: warning: current start runlevel(s) (empty) of script `redis-server' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `redis-server' overrides LSB defaults (0 1 6).
Removed symlink /etc/systemd/system/redis.service.

沒有留言:

張貼留言