Pi startup program

From: Chris (CHRISSS) 8 Feb 2016 21:00
To: ALL1 of 15
How do I make a program run when the Pi boots? I've tried before but not managed it properly so I'm going to attempt it again.

I just read a guide which says to edit rc.local and add a line in there with & to make it run in a separate process. No luck. Nothing happens (or seems to). If I run rc.local when I've logged in it works but my program starts spewing it's output all over the console. Not so good.

Currently what I do is login to the Pi, run screen, run my program, detach the screen and let it do whatever it wants hidden away. Is there some way I can do something similariaraly automagicamatically?
From: ANT_THOMAS 8 Feb 2016 21:04
To: Chris (CHRISSS) 2 of 15
You can create an init script.

Or a very simple way is to use an @reboot line in crontab.

To prevent the output you can point it to /dev/null
 
Code: 
@reboot  /usr/local/sbin/mycommand.sh > /dev/null 2>&1


 
From: Chris (CHRISSS) 8 Feb 2016 21:15
To: ANT_THOMAS 3 of 15
Yay! That worked. Thanks Ant :) Finally working.
From: ANT_THOMAS 8 Feb 2016 21:17
To: Chris (CHRISSS) 4 of 15
(highfive)
From: Chris (CHRISSS) 8 Feb 2016 21:19
To: ANT_THOMAS 5 of 15
It's been a pain every time we've had a powercut so this will make it so much easier. First attempt last year stopped the Pi rebooting properly for some reason.
From: ANT_THOMAS 8 Feb 2016 21:32
To: Chris (CHRISSS) 6 of 15
Do you have regular power cuts?
From: Chris (CHRISSS) 8 Feb 2016 21:36
To: ANT_THOMAS 7 of 15
We've had a few brief ones with all the shitty weather we've had recently. Woken up a few times with the oven clock flashing at us in the morning.
From: graphitone 9 Feb 2016 09:23
To: Chris (CHRISSS) 8 of 15
Your oven's in the bedroom?
From: koswix 9 Feb 2016 10:26
To: graphitone 9 of 15
Dutch oven :C
From: graphitone 9 Feb 2016 11:44
To: koswix 10 of 15
I had to look that up on Urban Dictionary.  :-$
From: CHYRON (DSMITHHFX) 9 Feb 2016 14:21
To: graphitone 11 of 15
Mmmm

From: koswix 9 Feb 2016 20:11
To: graphitone 12 of 15
I only learnt it recently. Frum Urban Dictionary.  :$ :$ :$ :$ :$ :$ :$
From: Chris (CHRISSS)11 Feb 2016 00:44
To: koswix 13 of 15
I had to look that up too. Definitely some of that going on :)
From: Chris (CHRISSS)11 Feb 2016 00:45
To: graphitone 14 of 15
Where else would I put it? Would be dangerous in the bathroom with all the water.
From: graphitone11 Feb 2016 08:24
To: Chris (CHRISSS) 15 of 15
Oh yeah.  :-/

We should start a poll to get a general consensus on where you should stick your appliances white goods fiery pie making machine.