一,背景:
启动vsftpd时,服务不能顺利启动:根据提示可知:
[root@abin etc]# service vstfpd start
Redirecting to /bin/systemctl start vstfpd.service
Failed to start vstfpd.service: Unit not found.
[root@abin etc]# service vsftpd status
Redirecting to /bin/systemctl status vsftpd.service
● vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
[root@abin etc]# service vdftpd status
Redirecting to /bin/systemctl status vdftpd.service
Unit vdftpd.service could not be found.
[root@abin etc]# service vsftpd status
Redirecting to /bin/systemctl status vsftpd.service
● vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
[root@abin etc]# rpm -qa | grep vsftpd
vsftpd-3.0.2-25.el7.x86_64
[root@abin etc]# rpm -qa | grep vsftpd
vsftpd-3.0.2-25.el7.x86_64
[root@abin etc]# service vstfpd start
Redirecting to /bin/systemctl start vstfpd.service
Failed to start vstfpd.service: Unit not found.
二,解决:
首先看一下服务列表里有没有这个服务:
systemctl list-unit-files --type=service
然后查找
vsftpd相关的service
然后执行如下操作:
[root@abin etc]# service vsftpd status
Redirecting to /bin/systemctl status vsftpd.service
● vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
[root@abin etc]# service vsftpd.service restart
Redirecting to /bin/systemctl restart vsftpd.service
[root@abin etc]# service vsftpd status
Redirecting to /bin/systemctl status vsftpd.service
● vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
Active: active (running) since 五 2020-02-14 23:17:23 CST; 25s ago
Process: 10535 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
Main PID: 10539 (vsftpd)
Tasks: 1
CGroup: /system.slice/vsftpd.service
└─10539 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
2月 14 23:17:23 abin.com systemd[1]: Starting Vsftpd ftp daemon...
2月 14 23:17:23 abin.com systemd[1]: Started Vsftpd ftp daemon.