使用systemctl enable --now xxx方式 enable并启动xxx服务

[root@dbserver ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)
[root@dbserver ~]# systemctl enable --now firewalld
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
[root@dbserver ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-06-03 14:53:56 EDT; 4s ago
     Docs: man:firewalld(1)
 Main PID: 5518 (firewalld)
    Tasks: 2
   CGroup: /system.slice/firewalld.service
           └─5518 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Jun 03 14:53:55 dbserver systemd[1]: Starting firewalld - dynamic firewall daemon...
Jun 03 14:53:56 dbserver systemd[1]: Started firewalld - dynamic firewall daemon.
[root@dbserver ~]# ls -lrt /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service
lrwxrwxrwx. 1 root root 41 Jun  3 14:53 /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service -> /usr/lib/systemd/system/firewalld.service
[root@dbserver ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.5 (Maipo)
[root@dbserver ~]# ls -lrt /etc/systemd/system/multi-user.target.wants/firewalld.service
lrwxrwxrwx. 1 root root 41 Jun  3 14:53 /etc/systemd/system/multi-user.target.wants/firewalld.service -> /usr/lib/systemd/system/firewalld.service
[root@dbserver ~]#

 

你可能感兴趣的:(RHEL8,RHEL7)