← Back to team overview

ubuntu-phone team mailing list archive

starting a background proc from a desktop icon

 

Hello,

I have a .desktop file as:

$ cat .local/share/applications/unav-osm.desktop 
[Desktop Entry]
Name=unav-osm
Type=Application
Exec=sh -c /home/phablet/unav.sh
Icon=/userdata/system-data/opt/click.ubuntu.com/navigator.costales/0.57/icon.png
Terminal=false
X-Ubuntu-Touch=true

This starts fine the shell script from the Exec line which in turn does:

$ cat /home/phablet/unav.sh
#!/bin/sh 

cd /media/phablet/*/Maps
python3 -m http.server 8888 &
sleep 86400                 # 24h, i.e. for ever

The problem is:
- without the 'sleep 86400' the started proc python3 ... gets killed at the end
  of the script; as well 'nohup' does not help;
- with the 'sleep 86400', it works as expected but consumes a lot of CPU
  in the unity8 proc (perhaps because the rotating Ubuntu logo on the
  screen of the 'app');

Any ideas? Thanks

	matthias
-- 
Matthias Apitz, ✉ guru@xxxxxxxxxxx, ⌂ http://www.unixarea.de/  ☎ +49-176-38902045


Follow ups