SoftwarePi startup program

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Chris (CHRISSS)  
 To:  ALL
41685.1 
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?

Me
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Chris (CHRISSS)     
41685.2 In reply to 41685.1 
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


 
0/0
 Reply   Quote More 

 From:  Chris (CHRISSS)  
 To:  ANT_THOMAS     
41685.3 In reply to 41685.2 
Yay! That worked. Thanks Ant :) Finally working.

Me
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Chris (CHRISSS)     
41685.4 In reply to 41685.3 
(highfive)
0/0
 Reply   Quote More 

 From:  Chris (CHRISSS)  
 To:  ANT_THOMAS     
41685.5 In reply to 41685.4 
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.

Me
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Chris (CHRISSS)     
41685.6 In reply to 41685.5 
Do you have regular power cuts?
0/0
 Reply   Quote More 

 From:  Chris (CHRISSS)  
 To:  ANT_THOMAS     
41685.7 In reply to 41685.6 
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.

Me
0/0
 Reply   Quote More 

 From:  graphitone  
 To:  Chris (CHRISSS)     
41685.8 In reply to 41685.7 
Your oven's in the bedroom?
+1/1
 Reply   Quote More 

 From:  koswix  
 To:  graphitone     
41685.9 In reply to 41685.8 
Dutch oven :C

 ▪                    
             ┌────┐    ┌────┐                      
          │    │    │    │ ▪                    
          │    └────┘    │                      
          │   ──┐  ┌──   │ ▪                    
   ┌──────┤    ▪    ▪    │                      
  ┌┘      │              │ ▪                    
┌─┤       └──┐  │  │  ┌──┘                      
│ │          │ ││  ││ │   ┌─┐                   
│ │          └─┼┤  └┴─┴───┘ │                   
│ │           ─┘│           │                   
│ │   ┌──────┐  └┬──────────┘                   
  │   │      │   │                              
  │   │      │   │                              
  └───┘      └───┘                              
If Feds call you and say something bad on me, it may prove what I said are truth, they are afraid of it.
0/0
 Reply   Quote More 

 From:  graphitone  
 To:  koswix     
41685.10 In reply to 41685.9 
I had to look that up on Urban Dictionary.  :-$
+1/1
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  graphitone     
41685.11 In reply to 41685.10 
Mmmm


----
"I will continue to use the circumflex, and to judge those who don’t"
0/0
 Reply   Quote More 

 From:  koswix  
 To:  graphitone     
41685.12 In reply to 41685.10 
I only learnt it recently. Frum Urban Dictionary.  :$ :$ :$ :$ :$ :$ :$

 ▪                    
             ┌────┐    ┌────┐                      
          │    │    │    │ ▪                    
          │    └────┘    │                      
          │   ──┐  ┌──   │ ▪                    
   ┌──────┤    ▪    ▪    │                      
  ┌┘      │              │ ▪                    
┌─┤       └──┐  │  │  ┌──┘                      
│ │          │ ││  ││ │   ┌─┐                   
│ │          └─┼┤  └┴─┴───┘ │                   
│ │           ─┘│           │                   
│ │   ┌──────┐  └┬──────────┘                   
  │   │      │   │                              
  │   │      │   │                              
  └───┘      └───┘                              
If Feds call you and say something bad on me, it may prove what I said are truth, they are afraid of it.
0/0
 Reply   Quote More 

 From:  Chris (CHRISSS)  
 To:  koswix     
41685.13 In reply to 41685.9 
I had to look that up too. Definitely some of that going on :)

Me
0/0
 Reply   Quote More 

 From:  Chris (CHRISSS)  
 To:  graphitone     
41685.14 In reply to 41685.8 
Where else would I put it? Would be dangerous in the bathroom with all the water.

Me
0/0
 Reply   Quote More 

 From:  graphitone  
 To:  Chris (CHRISSS)     
41685.15 In reply to 41685.14 
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.
0/0
 Reply   Quote More 

Reply to All    
 

1–15

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats