我如何自动重启铬,如果它崩溃? [英] How can I automatically restart chromium if it crashes?

查看:116
本文介绍了我如何自动重启铬,如果它崩溃?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Kiosk模式中使用铬浏览器作为显示屏,但有时可能会崩溃。
如果发生这种情况,我希望能够终止/重新启动浏览器,但是我无法检查chrome的状态。



有没有人知道如何检查铬是否崩溃,或者配置chrome在崩溃时关闭?



Chromium 28.0.1500.52 Ubuntu 12.04

解决方案

将以下代码放在一个文件中,将其命名为任何你喜欢的(foo):

 #!/ bin / sh 
while:#run forever
do
铬浏览器
完成

然后执行:

  chmod + x foo 

使文件名为foo可执行文件。



当您的信息亭启动时,调用程序foo(您刚刚创建的文件)。

脚本运行chrome浏览器在永远做这个循环中。如果浏览器死亡(无论出于何种原因),该脚本将重新启动它。


I'm using chromium-browser in kiosk mode as a display, but from time to time it might crash. I'd like to be able to kill / re-start the browser if that happens, but I'm unable to check chrome's status.

Does anyone know how to check if chromium has crashed, or configure chrome to shutdown if it crashes?

Chromium 28.0.1500.52 Ubuntu 12.04

解决方案

Put the following code in a file, name it whatever you like (foo):

#!/bin/sh
while :        # run forever
do
   chromium-browser
done

Then execute:

chmod +x foo

to make the file named foo executable.

When your kiosk starts, invoke the program foo (the file you just created).

The script runs the chrome browser in a "do this forever" loop. If the browser ever dies (for whatever reason), the script will restart it.

这篇关于我如何自动重启铬,如果它崩溃?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆