trevorjdaniel
Posts: 25
Joined: Thu Jul 25, 2013 7:16 pm

Boot to Root and Run a Script?

Sun Aug 04, 2013 2:36 pm

Hi,

I have been trying to work out how to

1. Stop my pi booting into LXDE.
2. Boot to a command prompt as root.
3. Run a python script.

I have fallen at the first hurdle. :oops:

I found a posting that says run "sudo raspi-config" and in there is an option to configure whether the pi boots to LXDE - happy days! So, I told it NOT to boot to LXDE. But, now when the pi boots, it automatically runs raspi-config at startup.

I want to boot the pi to a command prompt as root, then run a python script.

Can anyone help please?

Thanks

Trev

itimpi
Posts: 1090
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact: Website

Re: Boot to Root and Run a Script?

Sun Aug 04, 2013 5:03 pm

When it runs raspi-config, just tell rasp-config you are finished. That should stop it running next time.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Boot to Root and Run a Script?

Sun Aug 04, 2013 6:21 pm

itimpi wrote:When it runs raspi-config, just tell rasp-config you are finished. That should stop it running next time.
That is certainly good advice, but it begs the question: Why (how) did it get into "auto-run-on-next-boot" mode in the first place? I saw nothing in the OP's description that indicated that it should do that. This makes me wonder if something else is going on - implying that the simple "do it and it will reset itself" advice is maybe not sufficient.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

trevorjdaniel
Posts: 25
Joined: Thu Jul 25, 2013 7:16 pm

Re: Boot to Root and Run a Script?

Sun Aug 04, 2013 6:30 pm

itimpi wrote:When it runs raspi-config, just tell rasp-config you are finished. That should stop it running next time.
it certainly does!!! thanks.

id been just hitting escape as all other settings seemed to save on the fly.

now to crack question 3.

trev

itimpi
Posts: 1090
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact: Website

Re: Boot to Root and Run a Script?

Sun Aug 04, 2013 7:26 pm

If you want something to be run on starting the system put the command into /etc/rc.local. If you want the system continue to a log in prompt then add an & character at the end of the line.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Boot to Root and Run a Script?

Sun Aug 04, 2013 8:10 pm

itimpi wrote:If you want something to be run on starting the system put the command into /etc/rc.local. If you want the system continue to a log in prompt then add an & character at the end of the line.
That is one of the many ways to do it - and about the most error-prone, especially for a new user of Unix/Linux.

Basically, there is a 2x2 matrix here - with skill of user on one axis, and whether this is just some odd daemon (like, say, the sshd process), or the main, primary app/usage of the Pi.

In only one of these boxes (high skill, odd daemon) is rc.local a good idea.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Return to “Beginners”