harishreddy
Posts: 2
Joined: Wed Jul 11, 2018 9:37 am

Autorun C program on Raspberry Pi

Wed Jul 11, 2018 9:48 am

Hi,

We are using Raspbian whezzy for windows system on raspberry pi 1 model .we are unable to run c program automatically please share lx terminal commands

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 19822
Joined: Sat Jul 30, 2011 7:41 pm

Re: Autorun C program on Raspberry Pi

Wed Jul 11, 2018 10:55 am

Not sure what you are trying to achieve, but somethings that might help/

Windows doesn't run on the Pi, and Window's programs do not run on the Pi.

If you have a C file, you need to compile it before it will run. Have you done that?

Do you mean run automatically when the system starts up?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

harishreddy
Posts: 2
Joined: Wed Jul 11, 2018 9:37 am

Re: Autorun C program on Raspberry Pi

Thu Jul 12, 2018 7:30 am

#Do you mean run automatically when the system starts up?
Yes

jahboater
Posts: 2719
Joined: Wed Feb 04, 2015 6:38 pm

Re: Autorun C program on Raspberry Pi

Thu Jul 12, 2018 8:13 am

One simple way is to put the full path of your executable in a file called
/etc/rc.local
place it just before the final "exit 0" line.
It will be run as "root", so be careful.
There are other methods, a systemd service or a crontab entry.

User avatar
RaTTuS
Posts: 9924
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Autorun C program on Raspberry Pi

Thu Jul 12, 2018 8:16 am

why are you using wheezy ?
it make more sense to make a new Stretch version but
viewtopic.php?t=7192
will help
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

DirkS
Posts: 8078
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Autorun C program on Raspberry Pi

Thu Jul 12, 2018 8:17 am

jahboater wrote:
Thu Jul 12, 2018 8:13 am
There are other methods, a systemd service.
OP is running Wheezy, so no systemd...

Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 3 guests