Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkilling jarvis (in background) doesn't stop python used by snowboy #19

Closed
alexylem opened this issue Jun 26, 2016 · 5 comments
Closed
Assignees
Labels

Comments

@alexylem
Copy link
Owner

alexylem commented Jun 26, 2016

$> ./jarvis.sh -b
$> pgrep -af jarvis.sh
6193 /bin/bash ./jarvis.sh -n
$> top
PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND    
 6263 pi        20   0   31328  12280   8524 S   5.6  1.4   0:04.51 python     
$> pkill -f jarvis
$> pgrep -af jarvis.sh
(no process)
$> top
PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND    
 6263 pi        20   0   31328  12280   8524 S   6.0  1.4   0:08.05 python     

Problème: relancer Jarvis va accumuler des process python (pour snowboy), solliciter de plus en plus le CPU et mettre en échec le micro.

@alexylem alexylem added the bug label Jun 26, 2016
@alexylem alexylem self-assigned this Jun 26, 2016
@alexylem
Copy link
Owner Author

alexylem commented Jun 27, 2016

Je me retrouve régulièrement avec le CPU à 100% à cause d'un processus python snowboy qui traine.
Vérifier avec:

htop
pgrep -fa python
pkill -f python

@alexylem
Copy link
Owner Author

alexylem commented Jun 27, 2016

En envoyant SIGINT (Ctrl+C) à Jarvis en mode normal, cela arrête bien le processus snowboysigint

@alexylem
Copy link
Owner Author

alexylem commented Jun 27, 2016

J'arrive à stopper jarvis et ses sous process en tuant le groupe directement

$> ./jarvis.sh -b # jarvis lancé en tâche de fond
$> pgrep -fa jarvis.sh
14891 /bin/bash ./jarvis.sh -n # process id de jarvis.sh
$> pgrep -fa python
14965 python stt_engines/snowboy/main.py stt_engines/snowboy/resources/snowboy.umdl # process id de snowboy
$> ps -p 14891 -o pgid=
14882 # group id de jarvis.sh
$> kill -TERM -14882 # le (-) devant 14882 indique de tuer le groupe complet
$> pgrep -fa jarvis.sh
# aucun
$> pgrep -f python
# aucun

Voici la script pour tuer Jarvis proprement lorsqu'il est lancé en tâche de fond:

pid=`pgrep -f jarvis.sh` # process id de jarvis
gid=`ps -p $pid -o pgid=` # group id de jarvis
kill -TERM -$gid # tuer le group complet

@alexylem alexylem changed the title pkilling jarvis (in barground) doesn't stop python used by snowboy pkilling jarvis (in background) doesn't stop python used by snowboy Jun 27, 2016
@alexylem
Copy link
Owner Author

A été implémenté dans la mise à jour qui détecte si Jarvis tourne déjà en tâche de fond et propose de l'arrêter.

@alexylem alexylem added this to the Très bientôt milestone Jun 27, 2016
@trarizakaria
Copy link

re Alex j'espère que tu vas bien ! j'ai encore ce soucis. jarvis plante en mode service et puis j'arrive plus à l'arrêter
./jarvis.sh -q me renvoie qu'il est fermé. mais il reste toujours en backround, seule solution c'est redémarrer le raspberry.
j'ai essayé de suivre ce qui est dit sur ce Issue mais j'arrive pas à comprendre
salutations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants