如何在启动时禁用VMware服务?

如何在启动时禁用VMware服务?

我只是很少使用VMware,所以我想禁用它的服务,如果我需要运行VMware,只需手动启动它。但是执行systemctl disable vmware.service不会做任何事情,在我重新启动后服务仍然在运行。

这是服务状态的输出

● vmware.service - LSB: This service starts and stops VMware services
   Loaded: loaded (/etc/init.d/vmware; generated)
   Active: active (running) since Tue 2019-12-03 07:08:24 PST; 1h 56min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2187 ExecStart=/etc/init.d/vmware start (code=exited, status=0/SUCCESS)
    Tasks: 10 (limit: 4915)
   Memory: 16.4M
   CGroup: /system.slice/vmware.service
           ├─2292 /usr/lib/vmware/bin/vmware-vmblock-fuse -o subtype=vmware-vmblock,default_permissions,allow_other /var/run/vmblock-fuse
           ├─2320 /usr/bin/vmnet-bridge -s 6 -d /var/run/vmnet-bridge-0.pid -n 0
           ├─2330 /usr/bin/vmnet-netifup -s 6 -d /var/run/vmnet-netifup-vmnet1.pid /dev/vmnet1 vmnet1
           ├─2341 /usr/bin/vmnet-dhcpd -s 6 -cf /etc/vmware/vmnet1/dhcpd/dhcpd.conf -lf /etc/vmware/vmnet1/dhcpd/dhcpd.leases -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1
           ├─2344 /usr/bin/vmnet-natd -s 6 -m /etc/vmware/vmnet8/nat.mac -c /etc/vmware/vmnet8/nat/nat.conf
           ├─2346 /usr/bin/vmnet-netifup -s 6 -d /var/run/vmnet-netifup-vmnet8.pid /dev/vmnet8 vmnet8
           ├─2352 /usr/bin/vmnet-dhcpd -s 6 -cf /etc/vmware/vmnet8/dhcpd/dhcpd.conf -lf /etc/vmware/vmnet8/dhcpd/dhcpd.leases -pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8
           └─2377 /usr/sbin/vmware-authdlauncher

Dec 03 07:08:23 pop-os-asus vmnetBridge[2320]: RTM_NEWROUTE: index:3
Dec 03 07:08:23 pop-os-asus vmnetBridge[2320]: RTM_DELROUTE: index:3
Dec 03 07:08:24 pop-os-asus vmnet-natd[2344]: RTM_NEWLINK: name:enp2s0 index:2 flags:0x00001003
Dec 03 07:08:24 pop-os-asus vmnet-natd[2344]: RTM_NEWLINK: name:wlp3s0 index:3 flags:0x00011043
Dec 03 07:08:24 pop-os-asus vmnet-natd[2344]: RTM_NEWROUTE: index:3
Dec 03 07:08:24 pop-os-asus vmnet-natd[2344]: RTM_NEWADDR: index:3, addr:192.168.10.3
Dec 03 07:08:24 pop-os-asus vmware[2187]: [29B blob data]
Dec 03 07:08:24 pop-os-asus vmware[2187]: [41B blob data]
Dec 03 07:08:24 pop-os-asus vmware[2187]: [36B blob data]
Dec 03 07:08:24 pop-os-asus systemd[1]: Started LSB: This service starts and stops VMware services.

编辑

另外,当我执行systemctl is-enabled vmware.service输出时

vmware.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install is-enabled vmware
disabled

答案1

当我执行时systemctl is-enabled vmware.servicesystemd-sysv-install我的注意力被谷歌搜索了一下,它指出了 update-rc.d。

然后在手册页上有这个update-rc.d name disable|enable [ S|2|3|4|5 ]

所以我只是执行update-rc.d vmware disable,然后重新启动后 vmware 不再在启动时运行,但我仍然可以systemctl start vmware根据需要启动它。

相关内容