[#!/fr] ps et Launchd

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Maurice Inzirillo 4DNC
Date:  
À: La liste francophone des scripts shell
Sujet: [#!/fr] ps et Launchd
Bonjour à tous,

J'ai un petit soucis avec launchd sous Mac OS X 10.4.11. J'utilise
l'interface Lingon 1.2.1


J'ai un shell script qui récupère le numéro d'un PID par ces lignes

#!/bin/bash
PID1=`ps x | grep -v grep | grep '/Users/me/Desktop/myFolder.com/My
Server.app/Contents/MacOS/My Server' | cut -c1-5`
echo "process : $PID1";
if [ -n "$PID1" ]
then
echo "step1";
else echo "step2";
fi


Problème.

Lorsque je lance ce script depuis le terminal, j'obtiens bien un PID
lorsque mon application est active

Lorsque ce script est invoqué depuis launchd PID est vide alors que
mon application tourne ! :-/

Voici la plist utilisée avec launchd.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd
">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <true/>
    <key>Label</key>
    <string>com.4dnc.launchd.MyApp</string>
    <key>ProgramArguments</key>
    <array>
        <string>sh</string>
        <string>/Users/me/Desktop/MyApp_Ctrl.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StartInterval</key>
    <integer>300</integer>
</dict>
</plist>



Quelqu'un aurait une idée, une piste ?

Merci d'avance

Maurice Inzirillo
-- 
4D NET Center S.A.


4DBK 3.1 <http://www.4dbk.com/>
Téléphone : +41 (0)32 342 27 32
email : maurice.inzirillo@???
iChat : maurice_inzirillo@???
Skype : maurice.inzirillo



_______________________________________________
archives : 
http://listes.patpro.net/list/sshfr.fr.html
http://listes.patpro.net/mailman/listinfo/script_shell_fr