当然,这里的前提是你已经安装了mentohust,
pgrep -u root mentohust
kill [pid]
sudo mentohust -u[user] -p[password]
ok,结束已有的进程,重启服务,解决了。。
如何开机自动运行mentohust呢??
http://my.oschina.net/wanborj/blog/55635 中也有相应的介绍,笔者测试成功。
但是问题出现了。。
shutdown -P now后,mentohust进程无法终止
查看wiki是一个很好的学习习惯,上面无非也是下面的两种方法:
第一种方法:
chmod u+x mentohust
应用程序->添加应用程序:
这样添加完就ok了。
第二种方法:
vim /etc/rc.local,通常只有r权限,当然,你可以 chmod一下.
在exit之前加入:
if [ -x /usr/bin/mentohust ]; then
/usr/bin/mentohust
fi
ok,搞定!
笔者想了一种办法:
vim /etc/init.d/login.sh
sudo mentohust<<"root";
# if you have:chomd u+x mentohust
# mentoust;
if [ shutdown -P | -r ]
then
$temp = pgrep -u root mentohust;
kill temp;
fi
#本人第一次写shell,所以,命令调用的条件控制不会,希望大虾们指指错。