User avatar
faramon
Posts: 123
Joined: Sat Jun 11, 2016 8:36 am
Location: Croatia

BASH

Tue Jan 31, 2017 5:40 pm

Hi, one question for BASH call...

In my post about mission planner I ask a question but theme is not in that scope I think...
My exe is installed and works.
It is in directory:
/home/pi/workspace
It can be started from same directory:
cd /home/pi/workspace
and then:
sudo mono MissionPlanner.exe

but, how to start at boot or restart from bash with calling through directory?
What to put into desktop file that I have in Exec call, can this works?:
/home/pi/.config/autostart/autostart.desktop
This if desktop file:

Code: Select all

[Desktop Entry]
Type=Application
Name=MissionPlanner
Exec=sudo /home/pi/workspace mono MissionPlanner.exe
StartupNotify=false
I ask because it seems that it does not work...
Thanx,
Faramon

User avatar
Paeryn
Posts: 2966
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: BASH

Tue Jan 31, 2017 6:32 pm

I think you can set the working directory that the program has by adding to your .desktop file

Code: Select all

Path=/home/pi/workspace
She who travels light — forgot something.

User avatar
faramon
Posts: 123
Joined: Sat Jun 11, 2016 8:36 am
Location: Croatia

Re: BASH

Wed Feb 01, 2017 8:31 am

Ok, but is there something special to position in this directory from BASH?

Can I put something like:

Code: Select all

Path=/home/pi/workspace
Exec=sudo mono Path/MissionPlanner.exe
will this work? I have somewhere Node.js application that is started the same way, I will testing with it when I found it on my second Raspberry Pi...

User avatar
Paeryn
Posts: 2966
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: BASH

Wed Feb 01, 2017 8:52 am

faramon wrote:Ok, but is there something special to position in this directory from BASH?

Can I put something like:

Code: Select all

Path=/home/pi/workspace
Exec=sudo mono Path/MissionPlanner.exe
will this work? I have somewhere Node.js application that is started the same way, I will testing with it when I found it on my second Raspberry Pi...
The Path= line sets the working directory (i.e. the directory from which the application will be run).

Code: Select all

Path=/home/pi/workspace
Exec=sudo mono MissionPlanner.exe
Or

Code: Select all

Path=/home/pi/workspace
Exec=sudo mono /home/pi/workspace/MissionPlanner.exe
Bash isn't relevant here, you are running an executable directly from the desktop process, Bash isn't running it.
She who travels light — forgot something.

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: BASH

Wed Feb 01, 2017 8:52 am

Stop using sudo. You don't need sudo for everything.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
faramon
Posts: 123
Joined: Sat Jun 11, 2016 8:36 am
Location: Croatia

Re: BASH

Wed Feb 01, 2017 8:56 am

Thanx Paeryn I will try this...

And Dougie, yes, I always try first without sudo and last with sudo...

Return to “General discussion”