How to restart ES from a script?
-
@TMNTturtlguy No there is no difference in mine or meleus method. Both methods can run into trouble!
-
-
@TMNTturtlguy hey bro, Linux shell is very rigorous with typing! :)
- use
emulationstat
notemulastionstat
- use
/tmp/
not/temp
- use
-
@meleu sorry, i am trying to work on work and do this at the same time, i am failing! give me a second
-
@TMNTturtlguy Please don't get me wrong he needed the PID.
Edit: Sorry for that kind of work! I know you just want to help :)868 emulationstatio 874 emulationstatio 877 emulationstatio
That are three PIDs
I kill only 877output of mine via echo echo $(pgrep -l -n emulationstatio | awk '!/grep/ {printf "%s ",$1}') results: 877 I kill 877 with kill 877 after checking again I see 3 PIDs 868 874 1026
your command
I use e param for listing: pkill -f -e "/opt/retropie/supplementary.*emulationstation([^.]|$)" emulationstatio killed (pid 874) emulationstatio killed (pid 877)
after
with: pgrep -lf emulationstat nothing
So the whole system is killed!
-
Here is the touch line - this is the same error i get when i run from my script and what happens now when i use @cyperghost script a 2nd time. First, this is what i typed in when retropie was running properly:
And here is the outcome on the pi - no output in putty command line
running pgerp -lf emulationstat now gives no output at all.
when i touch a button on my controller i exit to a black screen on the pi, have to sudo reboot. -
@TMNTturtlguy Please delete /tmp/es-restart manually
What has OMX-Player to do with Emulationstation?pleas @TMNTturtlguy
Try this in shell output ofps -a
in shell
echo $(pgrep -l -n emulationstatio | awk '!/grep/ {printf "%s ",$1}')
No worries you can't make mistakes with that. That are all output commands.
-
@cyperghost that is the thing, i don't have a /tmp/es-restart to delete, it isn't there! I am pretty confused, when i did my attempts running touch es-restart I always got a /tmp/ file. any issues, just sudo rm and it was fixed. Now i don't see a /tmp/es-restart file, however it is retaining the error screen from @meleu script.
As you might be able to tell, i am not a coder, so i am really stretching here creating this stuff. It is fun, but there is a lot I don't understand. Can you provide more info on what you want me to do? Not sure what you mean by :
Try this in shell output of ps -a
in shell
echo $(pgrep -l -n emulationstatio | awk '!/grep/ {printf "%s ",$1}') -
@TMNTturtlguy I'll sort it this evening, but when that happens with your terminal try to (maybe blindly) type
reset
and press enter. -
@TMNTturtlguy
connect via SSH
in prompt typeps -a
That list all process with tty1 outputthen create the file es-restart with sudo command
sudo touch /tmp/es-restart
check existance with
ls /tmp
into the ps list... take the pid from ES with the highst number (that's the latest processes) and type
kill 1234
your PID here should not be 1234 ;)after that
ps -a
again... What do you see? -
@cyperghost maybe
ps -a | grep emulationsta
can give a cleaner output for him. :) -
@meleu well that are only 2 or three more processes - clean enough but thank you ;)
@TMNTturtlguy I'm also not a coder - I made my master degree in chemistry
-
@cyperghost thanks for explaining!
To answer your question from the previous post - OMX is the screensaver running, part of a new update to ES.
here is my output - when i ran the kill line, it killed the screensaver.
-
yes that's it...
You see so it works...
You killed ES with PID 941This was terminated
and relaunched as new
ES with PID 1500meleus script would kill
938 and 941
you can check with (the -e parameter shows list of killed PIDs)pkill -f -e "/opt/retropie/supplementary.*emulationstation([^.]|$)"
after meleus script all emulationstation PIDs are gone >> dead!
-
@cyperghost What's the problem with sending a SIGINT to all processes rather than one ?
@TMNTturtlguy es-restart will get removed by the ES launch script hence why it disappears.
-
@BuZz Well ... You are the coding wizard :)
I think if you show us a way to solve this proper please go on.
Maybe you can make this waterproof? Or tell us something behind the scene of RetroPie?
Your are welcome! -
@cyperghost I'm not sure what the problem is ? :)
[edit] is it still the same issue as in the OP ? I'd have to test, but it should be ok to killall on ES, which would also kill the current running script of course as it's a child process itself.
-
@BuZz ... and you ask me? :D
-
That did it! Success....I am now back to running without getting the errors. @cyperghost your script does work well. I am going to upload the update to github. If you are willing it would be great for you to test. It is easy for you to delete the script after testing if you don't find it useful. Thanks for all the help. Will be interested to see how updates to ES will affect this.
-
@BuZz
The problem is that you can't kill ES with killall command.
It will return to bash prompt and you are not able to restart in graphical mode on your TV (via SSH yes that works)So I seem to kill the latest child process that forces ES to restart IF a es-restart is present in /tmp
meleus script kills two pids... and then ES is gone like killall.
Maybe now you understand my "EUREKA" ;)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.