Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service ssh
service与/etc/init.d
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service network-manager restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart network-manager
现在Ubuntu启动,关闭服务不能用/etc/rc*.d/init.d/{Service} {start|stop|restart}了,需要用service {Service} {start|stop|restart}。在网上搜索后发现原因是Ubuntu10.04后引入了upstart来管理自启动服务。旧的系统管理被称作SysV,它通过在代表各个run level的目录里建立脚本来控制服务的自动启动。比如,/etc/rc0.d目录里以S开头的脚本会被运行在runlevel 0。在这种方式下,如果要屏蔽一个服务,需要把S开头的那个更名为以K开头。而所以在rc*.d下的脚本都链接到/etc/init.d目录里。而Upstart采用了完全不同的方式。它要求所有的启动脚本,其实是配置文件,建立在/etc/init目录下,每个服务一个文件,里面定义脚本启动与关闭的运行级别、条件、事件,等。可以看得出,Upstart要比SysV高明得多,因为SysV启动是线性、顺序的,一个S20的服务必须要等待S19启动完成才能启动,如果一个启动要花很多时间,那么后面的服务就算完全无关,也必须要等。而在Upstart下,服务的启动基于事件,而且是并行的,只要事件发生,服务可以并发启动。这种方式无疑要优越得多,因为它可以充分利用现在计算机多核的特点,大大减少启动所需的时间。
RSA host key has changed error
解决方案:执行ssh-keygen-R IP