doragasu
Member
- Joined
- Jun 2, 2008
- Messages
- 325
I have built telegram command line client and if copy the files, open a terminal and manually launch it, it runs perfect. But when I try launching it from a PND, the terminal window pops up for a fraction of second, and closes.
This is the file tree I'm using:
.
├── lib
│ └── libconfig.so.8
├── PXML.xml
├── telegram
│ ├── telegram
│ └── tg.pub
├── telegram.png
├── telegram-preview.png
├── telegram-readme.md
└── telegram.sh
This is the launch script telegram.sh:
#!/bin/sh
export HOME=/mnt/utmp/telegram
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/mnt/utmp/telegram/lib
cd telegram
terminal -e "bash ./telegram"
# Wait for telegram to finish
for pid in $(ps hX | awk '{print $1}')
do
command=$(ps h --pid $pid -o command)
if [ "$command" == "bash ./telegram" ]
then
alive=1
while [ "$alive" -eq "1" ]
do
sleep 1s
kill -0 $pid;
if [ "$?" -ne "0" ]; then
alive=0
fi
done
fi
done
fi
And this is the resulting pndrun_telegram.out file:
=======================================================================================
PND : /media/mmcblk0p1/pandora/menu/telegram-cli.pnd
PND_FSTYPE : ISO
APPDATADIR : /media/mmcblk0p1/pandora/appdata/telegram
APPDD_FSTYPE : vfat
PND_CPUSPEED : 800
EXENAME : telegram.sh
ARGUMENTS : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -o ro "/dev/loop0" "/mnt/utmp/telegram"
Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/mmcblk0p1/pandora/appdata/telegram=rw+nolwh":"/mnt/pnd/telegram=rr" none "/mnt/utmp/telegram"
[SUCCESS]--- Mount the PND ----------
[ START ]--- Set CPU speed ----------
[SUCCESS]--- Set CPU speed ----------
[ START ]--- Starting the application ( telegram.sh ) ----------
(terminal:5584): Terminal-DEBUG: D-Bus reply error: Name "org.xfce.Terminal4" does not exist (terminal-error-quark: 4)
./telegram.sh: line 24: syntax error: "fi" unexpected
[ FAILED]--- Starting the application ( telegram.sh ) ----------
[ START ]--- Restoring the frame buffer status ----------
[SUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[SUCCESS]--- Waiting the Union to be available ----------
auplinklink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
rmdir: failed to remove `/mnt/utmp/telegram': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[SUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[SUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 4
Any suggestions?
This is the file tree I'm using:
.
├── lib
│ └── libconfig.so.8
├── PXML.xml
├── telegram
│ ├── telegram
│ └── tg.pub
├── telegram.png
├── telegram-preview.png
├── telegram-readme.md
└── telegram.sh
This is the launch script telegram.sh:
#!/bin/sh
export HOME=/mnt/utmp/telegram
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/mnt/utmp/telegram/lib
cd telegram
terminal -e "bash ./telegram"
# Wait for telegram to finish
for pid in $(ps hX | awk '{print $1}')
do
command=$(ps h --pid $pid -o command)
if [ "$command" == "bash ./telegram" ]
then
alive=1
while [ "$alive" -eq "1" ]
do
sleep 1s
kill -0 $pid;
if [ "$?" -ne "0" ]; then
alive=0
fi
done
fi
done
fi
And this is the resulting pndrun_telegram.out file:
=======================================================================================
PND : /media/mmcblk0p1/pandora/menu/telegram-cli.pnd
PND_FSTYPE : ISO
APPDATADIR : /media/mmcblk0p1/pandora/appdata/telegram
APPDD_FSTYPE : vfat
PND_CPUSPEED : 800
EXENAME : telegram.sh
ARGUMENTS : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -o ro "/dev/loop0" "/mnt/utmp/telegram"
Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/mmcblk0p1/pandora/appdata/telegram=rw+nolwh":"/mnt/pnd/telegram=rr" none "/mnt/utmp/telegram"
[SUCCESS]--- Mount the PND ----------
[ START ]--- Set CPU speed ----------
[SUCCESS]--- Set CPU speed ----------
[ START ]--- Starting the application ( telegram.sh ) ----------
(terminal:5584): Terminal-DEBUG: D-Bus reply error: Name "org.xfce.Terminal4" does not exist (terminal-error-quark: 4)
./telegram.sh: line 24: syntax error: "fi" unexpected
[ FAILED]--- Starting the application ( telegram.sh ) ----------
[ START ]--- Restoring the frame buffer status ----------
[SUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[SUCCESS]--- Waiting the Union to be available ----------
auplinklink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
rmdir: failed to remove `/mnt/utmp/telegram': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[SUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[SUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 4
Any suggestions?