cleathy
Posts: 8
Joined: Fri Mar 27, 2015 9:09 pm

Commands when starting

Fri Apr 17, 2015 11:43 pm

Hi

I was wondering how can i get my Raspberry Pi to run these commands when starting?

Code: Select all

cd C-Berry/SW/fb2cberry
make
sudo mv fb2cberry /usr/local/bin/fb2cberry
sudo fb2cberry &
Thanks (:

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Commands when starting

Sat Apr 18, 2015 5:52 am

So, without any checks at all, you want your RPi (which model) to compile some source, move it into /usr/local/bin/ and execute it at system startup? Why? Dangerous! ... warning Will Robinson, Danger...

The answer to your question relies on your knowledge of init. The RPi uses 'init' to control system startup. So, you will want to read up on init.d, run levels startup rc0.d rc1.d rc2.d etc, rcS.d , rc.local... and so forth. This is all located in /etc.

Probably you will want to place your startup stuff in rc.local. But, I would never compile sources (make) and without any check whatsoever move that object into /usr/local/bin for execution in the background! That's nuts. So, rethink what you're trying to do, and come up with a better solution.

Cheers,
marcus
:)
marcus
:ugeek:

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

Re: Commands when starting

Sat Apr 18, 2015 9:00 am

cleathy wrote:Hi

I was wondering how can i get my Raspberry Pi to run these commands when starting?

Code: Select all

cd C-Berry/SW/fb2cberry
make
sudo mv fb2cberry /usr/local/bin/fb2cberry
sudo fb2cberry &
Thanks (:
What possible reason would you have to make and install a new copy of your program every time you boot?
That's normally a one-off operation (until the code changes for some reason).
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 fake doctors are on my foes list.

Return to “Beginners”