This question already has an answer here:
I created the following Desktop Entry:
[Desktop Entry] Type=Application Terminal=true Name=<name> Exec=<pathTOscript/myScript.sh>
myscript.sh is just one command to start a service. The service starts the programm itself (CNTLM) and another script (own state).
sudo /etc/init.d/cntlm <ownstate>
Now my problem:
When I type the above command into a terminal: CNTLM stops, the script is executed, CNTLM starts, everything works fine.
However, when I click the shortcut, the terminal closes before CNTLM starts again.
Changing my .desktop to this solved the problem: Found it in this post.
[Desktop Entry] Type=Application Terminal=true Name=<name> Exec=gnome-terminal -e "bash -c 'sudo /etc/init.d/cntlm <ownstate>;$SHELL'"
The important here was "$SHELL".