一、查看ftp是否自启
[root@localhost /]# chkconfig --list|grep vsftpd
vsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost /]# chkconfig vsftpd on
上面这条命令设置vsftpd自启动
[root@localhost /]# chkconfig --list|grep vsftpd
vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
报错
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.
SysV已经快退居二线了,想配置服务得用systemctl,先看看默认启动的服务吧。(如果不用grep过滤一下,输出结果有260多行)
[root@localhost ~]# systemctl list-unit-files|grep enabled
tmp.mount enabled
accounts-daemon.service enabled
atd.service enabled
auditd.service enabled
avahi-daemon.service enabled
bluetooth.service enabled
chronyd.service enabled
crond.service enabled
dbus-org.bluez.service enabled
dbus-org.Fedoraproject.FirewallD1.service enabled
dbus-org.freedesktop.Avahi.service enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
display-manager.service enabled
dmraid-activation.service enabled
firewalld.service enabled
gdm.service enabled
getty@.service enabled
irqbalance.service enabled
iscsi.service enabled
kdump.service enabled
libstoragemgmt.service enabled
lvm2-monitor.service enabled
mdmonitor.service enabled
microcode.service enabled
multipathd.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager.service enabled
packagekit-offline-update.service enabled
postfix.service enabled
rngd.service enabled
rsyslog.service enabled
rtkit-daemon.service enabled
smartd.service enabled
spice-vdagentd.service enabled
sysstat.service enabled
systemd-readahead-collect.service enabled
systemd-readahead-drop.service enabled
systemd-readahead-replay.service enabled
tuned.service enabled
avahi-daemon.socket enabled
dm-event.socket enabled
iscsid.socket enabled
iscsiuio.socket enabled
lvm2-lvmetad.socket enabled
default.target enabled
multi-user.target enabled
remote-fs.target enabled
使用指令systemctl enable vsftpd
再次查看 systemctl list-unit-files|grep enabled