M
M
makecode2016-02-03 14:38:22
linux
makecode, 2016-02-03 14:38:22

How to restart browser on Linux via PHP?

Hello. The essence of the question is this. I have a script running in my browser and to see if it works or not, I did this: The script requests my server once a minute and I mark the time in the database. If the time is long, then I receive a notification in the mail to check the script. I log in via SSH and it happens that either the 500 error or the browser stupidly crashed and had to be restarted.
I can't think of a mechanism that would implement the following:
1) I check the Restart browser checkbox in my panel and the script itself on that server checks if the checkbox is checked, then somehow restarts the browser.
2) The script itself monitors the state of the browser, if there is no such process, then it restarts.
How can this be implemented? I guess there must be some kind of daemon / application that runs in the background and checks the server base for a tick and sees if there is a browser process. But I don't know exactly how to do it.
If possible, at least in general terms, how can this be implemented? Thank you.
Add
In general, I need to remotely restart the browser, but in such a way that it is initiated via PHP from another computer.
Those. 1st computer there is a browser
2nd computer there is an admin panel with a restart tick.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2016-02-03
@DmitriyEntelis

why so perverted and run the script in the browser?
run in the server console through nohup and that's it.
PS answer "on the forehead": in order to do something on the local machine - you need the code to be executed on the local machine. That is, in any programming language, you need to write code that will check something on the local machine and, depending on this, do something. If the local machine is linux, you can write yes, even on the same php. Through exec pull ps | grep chrome ... sudo kill ... etc.

S
Slava Kryvel, 2016-02-03
@kryvel

Is there a reason to run the script in the browser?
Why are you not satisfied with cron ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question