runcommand-onend.sh: error on "kill xboxdrv"
-
Hi all,
I get an error when I try to useruncommand-onend.sh
to kill the xboxdrv instance.My
runcommand-onend.sh
is as simple as as:pi@retropie:~ $ cat /opt/retropie/configs/all/runcommand-onend.sh #!/bin/sh sudo killall xboxdrv #sudo killall > /dev/null 2>&1 xboxdrv
Emulationstation exits to shell, the following error is printed and the system becomes unresponsive to the attached keyoard, but I can still login via ssh (and issue a reboot).
emulationstation: /home/pi/RetroPie-Setup/tmp/build/emulationstation/es-core/src/InputManager.cpp:71: void InputManager::addJoystickByDeviceIndex(int): Assertion `joy' failed. Aborted
This happens only when the kill command is run from
runcommand-onend.sh
; if I exit to shell and type it, there are no errors.I'm using:
- Pi 3
- Power Supply: 5V/2.5A Power Adapter (see this kit)
- RetroPie Version: v4.3 (September 2017)
- Built from pre made SD Image on RetroPie website
- USB Devices connected: 1 wireless logitech keyboard, 1 wired mouse
- Controller used: 2x wiimotes + SNES mini controller,
connected using MoltenGamepad
Both the controllers run fine without xboxdrv; I'm using the xboxdrv only for Amiga emulation (this is why I need to kill the driver on exit). - Guide used to configure xboxdrv: Universal Controller Calibration & Mapping Using xboxdrv
The controller (only one, I still haven't figured out how to use 2 different controllers on Amiga) runs fine on Amiga games; but at the moment I still have to exit to shell wiht
F4
and runsudo killall xboxdrv
manually.Any idea?
-
@yramrag Just a random thought... try it without the
shebang
. It seems counter-intuitive but myruncommand-onend.sh
for continuing the background music does not contain ashebang
-
@yramrag
Please try this after you tried @jonnykesh suggestions ;)Call a script from the
runcommand-onend.sh
with/pathtomyscript/yourscript.sh &
name it as you like and make it executable withchmod +x yourscript.sh
#!/bin/bash sleep 5 sudo killall xboxdrv
I would like to send the kill-script into the background with
&
and let runcommand end it's session. After 5 seconds the xboxdrv is terminated. -
@cyperghost Or he could try adding
bash "/path/to/my/script/location/scriptname.sh"
to theruncommand-onend.sh
Or try changing the shebang to bash, ie
#!/bin/bash
instead of#!/bin/sh
-
@jonnykesh Well....
ES itself reports an error. I think we should wait of yramrag feedback :)@yramrag
What will happen if you enterkillall xboxdrv
in a SSH session? -
@cyperghost Would
pkill
rather thankillall
make a difference? -
@jonnykesh pkill and killall are very equal if you use it with command programmname
But
pkill test
uses regex so all instanced that contains a pattern with test in it
it will kill test1, 1test, abctestabc... and so on. Therefore it would be better to usepkill -x
killall test
terminates all proceses that are named testTherefore I often use
pgrep
to determinate PID number and then kill the PID-number just bykill PID
... if I obtain more than one PID number withpgrep
something went wrong ;) More to read here -
@jonnykesh
No difference; with or without theshebang
I still get the same error.
Also, there's no difference with#!/bin/bash
instead of#!/bin/sh
.@cyperghost
This actually works!
Now myruncommand-onend.sh
is just/home/pi/bin/killxboxdrv.sh &
and
killxboxdrv.sh
is#!/bin/bash sleep 3 sudo killall xboxdrv
(I reduced sleep time from 5 to 3)
Many thanks to both of you!
-
@yramrag You're welcome
-
@yramrag No worries. I was just throwing out random ideas as opposed to actually understanding and fixing the issue! But it's always worth checking the easy stuff first. Glad to hear you are all sorted now.
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.