我在 ubuntu 14.04 上安装了 vsftpd,当我想停止或重新启动 vsftpd 服务时显示此消息,但服务状态没有任何反应!
root@ali-lap:/home/ali# service vsftpd restart
stop: Unknown job: vsftpd
start: Unknown job: vsftpd
Run Code Online (Sandbox Code Playgroud)
我根据这篇文章清除了 vsftpd 并重新安装了它,但没有任何改变。
安装和删除日志:
root@ali-lap:/home/ali# apt-get purge --remove vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
vsftpd*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 370 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 216263 files and directories currently installed.)
Removing vsftpd (3.0.2-1ubuntu2) ...
initctl: Unknown job: vsftpd
Purging configuration files for vsftpd (3.0.2-1ubuntu2) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for man-db (2.6.6-1) ...
root@ali-lap:/home/ali# ls -lpa /etc/vsftpd
vsftpd/ vsftpd.conf.orig
root@ali-lap:/home/ali# ls -lpa /etc/vsftpd.conf
ls: cannot access /etc/vsftpd.conf: No such file or directory
root@ali-lap:/home/ali# apt-get install vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
vsftpd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/112 kB of archives.
After this operation, 370 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package vsftpd.
(Reading database ... 216210 files and directories currently installed.)
Preparing to unpack .../vsftpd_3.0.2-1ubuntu2_amd64.deb ...
Unpacking vsftpd (3.0.2-1ubuntu2) ...
Processing triggers for man-db (2.6.6-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up vsftpd (3.0.2-1ubuntu2) ...
initctl: Unknown job: vsftpd
Processing triggers for ureadahead (0.100.0-16) ...
root@ali-lap:/home/ali# ls -lpa /etc/vsftpd.conf
-rw-r--r-- 1 root root 5654 ?? 16 2013 /etc/vsftpd.conf
Run Code Online (Sandbox Code Playgroud)
vsftpd 版本:
root@ali-lap:/home/ali# apt-cache policy vsftpd
vsftpd:
Installed: 3.0.2-1ubuntu2
Candidate: 3.0.2-1ubuntu2
Version table:
*** 3.0.2-1ubuntu2 0
500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
小智 5
我有一个类似的问题,发现它是由环境变量引起的。当您使用 时su
,它会保留UPSTART_SESSION
环境变量集(来自原始用户的环境),这会破坏事物。使用sudo
或su -
取消设置它,所以这些都可以工作:
$ sudo service vsftpd restart
Run Code Online (Sandbox Code Playgroud)
$ sudo su
# service vsftpd restart
Run Code Online (Sandbox Code Playgroud)
$ su -
# service vsftpd restart
Run Code Online (Sandbox Code Playgroud)
$ su
# unset UPSTART_SESSION
# service vsftpd restart
Run Code Online (Sandbox Code Playgroud)
小智 2
尝试使用 sudo,这似乎是一个错误,或者您没有 root 的服务权限。
$ sudo service vsftpd status
Run Code Online (Sandbox Code Playgroud)
应该有效,确实现在就在我眼前为我工作。