The Following User Says Thank You to Halftux For This Useful Post: | ||
|
2016-02-27
, 14:14
|
|
Posts: 868 |
Thanked: 2,516 times |
Joined on Feb 2012
@ Germany
|
#22
|
The Following 4 Users Say Thank You to Halftux For This Useful Post: | ||
|
2016-02-27
, 21:50
|
|
Posts: 868 |
Thanked: 2,516 times |
Joined on Feb 2012
@ Germany
|
#23
|
The Following 3 Users Say Thank You to Halftux For This Useful Post: | ||
|
2016-02-28
, 19:46
|
|
Posts: 6,447 |
Thanked: 20,981 times |
Joined on Sep 2012
@ UK
|
#24
|
|
2016-02-29
, 11:53
|
|
Posts: 868 |
Thanked: 2,516 times |
Joined on Feb 2012
@ Germany
|
#25
|
Hey Halftux, thanks a million for looking into this and sorry for the late feedback. Weekends are the busiest time. During the week I can (sometimes) steal some time from my employer but stealing it from the family is a bit more difficult
Unfortunately, neither a downgrade to 0.0.4 nor an upgrade to 0.0.8 and adding the --script option has made any difference. The script still freezes when launched from cron.
|
2016-02-29
, 15:10
|
|
Posts: 868 |
Thanked: 2,516 times |
Joined on Feb 2012
@ Germany
|
#26
|
The Following User Says Thank You to Halftux For This Useful Post: | ||
|
2016-02-29
, 15:29
|
|
Posts: 6,447 |
Thanked: 20,981 times |
Joined on Sep 2012
@ UK
|
#27
|
Please start your script in cron like this: "sh gps.sh".
This could solve your issue.
[nemo@Dinghy ~]$ ps ax | grep gps 457 ? Ss 0:00 /bin/sh ./gpsconupload 458 ? S 0:00 /bin/sh ./gpsconupload 459 ? S 0:00 gpscon --script runs=3 1221 ? Ss 0:00 /bin/sh ./gpsconupload 1222 ? S 0:00 /bin/sh ./gpsconupload 1224 ? S 0:00 gpscon --script runs=3 1306 pts/0 S+ 0:00 grep gps [nemo@Dinghy ~]$
#!/bin/sh STR=`gpscon --script runs=3 | tail -n 1` LAT=`echo $STR | cut -d " " -f 2 | cut -d ";" -f 1` LON=`echo $STR | cut -d " " -f 4 | cut -d ";" -f 1` ALT=`echo $STR | cut -d " " -f 6` STR={\"gid\":\"`hostname`\",\"time\":`date +%s`,\"lon\":$LON,\"lat\":$LAT if [ $ALT != "nan" ]; then STR=$STR,\"alt\":$ALT fi STR=$STR} echo $STR >> ~/gpsconlog.txt
#!/bin/sh sh ./gpsconupload.do
[nemo@Dinghy ~]$ ps ax | grep gps 3871 ? Ss 0:00 sh ./gpsconupload 3872 ? S 0:00 sh ./gpsconupload.do 3873 ? S 0:00 sh ./gpsconupload.do 3874 ? S 0:00 gpscon --script runs=3 4076 ? Ss 0:00 sh ./gpsconupload 4077 ? S 0:00 sh ./gpsconupload.do 4078 ? S 0:00 sh ./gpsconupload.do 4079 ? S 0:00 gpscon --script runs=3 4088 pts/0 S+ 0:00 grep gps [nemo@Dinghy ~]$
The Following User Says Thank You to pichlo For This Useful Post: | ||
|
2016-02-29
, 18:46
|
|
Posts: 868 |
Thanked: 2,516 times |
Joined on Feb 2012
@ Germany
|
#28
|
I have no idea where the double entries (pid 457/458 and 1221/1222) come from.
Any idea what's going on here?
Cron has several enviromental variables configured in /etc/crontab, specifically SHELL and PATH. The default value for SHELL is /bin/sh. So unless this is changed or otherwise specified in a script, cron will execute commands using sh.
sh /opt/gps.sh
#!/bin/sh gpscon runs=3 --script > /home/user/MyDocs/gps2.txt
#!/bin/sh STR=`gpscon runs=3 --script` LAT=`echo $STR | cut -d " " -f 2 | cut -d ";" -f 1` LON=`echo $STR | cut -d " " -f 4 | cut -d ";" -f 1` ALT=`echo $STR | cut -d " " -f 6` STR={\"name\":\"`hostname`\",\"time\":`date +%s`,\"lon\":$LON,\"lat\":$LAT echo $STR > /home/user/MyDocs/gps2.log
14554 user 2084 S /bin/ash -c sh /opt/gps.sh 14555 user 2084 S sh /opt/gps.sh 14556 user 27632 S gpscon runs=3 --script 14560 user 2088 S grep gps
The Following User Says Thank You to Halftux For This Useful Post: | ||
|
2016-03-02
, 10:22
|
|
Posts: 868 |
Thanked: 2,516 times |
Joined on Feb 2012
@ Germany
|
#29
|
The Following User Says Thank You to Halftux For This Useful Post: | ||
|
2016-03-02
, 10:28
|
|
Posts: 6,447 |
Thanked: 20,981 times |
Joined on Sep 2012
@ UK
|
#30
|
The Following User Says Thank You to pichlo For This Useful Post: | ||
I think some how the default variable value will be used and this means last known value and endless loop.
If it is not your script (I still need to try) I could change the default values (options and variable) for gpscon or better writing a own argument parser which will work with this situation.
Never tried cron-scripts with gpscon now it is time to do so.
To safe power is priority number one.
N900: gpxsee, fahrplan, gpscon, genwall, qrcode, hextool, libjansson4, libevent-2.0-5, cnee, psi-plus, mihphoto, shc
Maemo flasher/rescue live image.
Fremantle Harmattan SDK VM
Last edited by Halftux; 2016-02-27 at 01:05. Reason: typo