Mentohust不能使用的解決辦法

固然,這裏的前提是你已經安裝了mentohust,java

pgrep -u root mentohust
kill [pid]
sudo mentohust -u[user] -p[password]

ok,結束已有的進程,重啓服務,解決了。。shell

如何開機自動運行mentohust呢??
http://my.oschina.net/wanborj/blog/55635 中也有相應的介紹,筆者測試成功。vim

可是問題出現了。。學習

shutdown -P now後,mentohust進程沒法終止

查看wiki是一個很好的學習習慣,上面無非也是下面的兩種方法:測試

第一種方法:.net

chmod u+x mentohustcode

應用程序->添加應用程序:blog

這樣添加完就ok了。進程

第二種方法:get

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,因此,命令調用的條件控制不會,但願大蝦們指指錯。
相關文章
相關標籤/搜索