TechnicalBooting lonely Linux

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Drew (X3N0PH0N)  
 To:  Manthorp      
41672.66 In reply to 41672.64 
Glad it's working.

You *should* now be able to just add the script you want to run to /etc/profile and it should run. That is if you're logging in automatically to a virtual terminal and not using a window manager. Ant's talk of window managers has me confused.

Edit: Although Ant's approach of running it as a daemon will make sure it comes back up if it crashes, which adding it to /etc/profile won't. So it's a better solution.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
41672.67 In reply to 41672.66 
You may not have used a window manager, I must admit I stopped reading a while back :$
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
41672.68 In reply to 41672.67 
////////// :O //////////
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
41672.69 In reply to 41672.68 
One of my RPis has decided to stop working at 7:15 this morning. No light, pressure, outdoor temp or box room temp data for me today :((
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
41672.70 In reply to 41672.69 
:|

How will you manage?
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
41672.71 In reply to 41672.70 
It is stressing me out :'(
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
41672.72 In reply to 41672.70 
Look at the missing data!!!

Attachments:

0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
41672.73 In reply to 41672.72 
I need to know the temperature of your box :((
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
41672.74 In reply to 41672.73 
37°C
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
41672.75 In reply to 41672.74 
Hot.
0/0
 Reply   Quote More 

 From:  graphitone  
 To:  Drew (X3N0PH0N)     
41672.76 In reply to 41672.75 
Filth.
0/0
 Reply   Quote More 

 From:  Manthorp   
 To:  Drew (X3N0PH0N)     
41672.77 In reply to 41672.66 
MY 'lonely' search index.js now lives and runs perfectly happily in /pi/.  So are you suggesting I  just add something like
Quote: 
. /home/pi/node index.js.sh
to the end of /etc/profile? I'm basing that on THIS article.  I'm cautious of doing anything that might fuck up my access to the terminal window on boot, so I want to get my code right.

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951
 
0/0
 Reply   Quote More 

 From:  Manthorp   
 To:  Manthorp      
41672.78 In reply to 41672.77 
I've also found THIS.  The "solution that works on bootup to the console" takes a very different approach.

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951
 
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Manthorp      
41672.79 In reply to 41672.78 
After boot means before login. That would launch your script as a daemon and would not (by default) output anywhere. The script's parent would be the init process rather than a particular terminal, like.

You want to launch the script as the child of the terminal after login, so you get output. So the best approach is to add it to /etc/profile (or ~/.bashrc (assuming you're using bash (you probably are))). /etc/profile will be run for any user that logs in whereas ~/.bashrc is specific to your user. Either is fine.

The code in your post above isn't quite right. You want to run your script with the node binary. The node binary is in your path (i.e. you can just call it by name like other system binaries). So you want to do:
 
Code: 
node /path/to/your/file.js

(I don't know why your index.js has a .sh extension. It shouldn't. It won't hurt but it's not right)

(The dot in your example is used to tell the shell to execute something that's not in your path. Since we're running node itself and then executing your script with node, you don't need it here)
 
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Manthorp      
41672.80 In reply to 41672.77 
Oh and:

>I'm cautious of doing anything that might fuck up my access to the terminal window on boot, so I want to get my code right.

You have many TTYs (terminals, basically) available. I don't know which one Debian uses at boot but you can press ctrl+alt+f1, f2, f3 etc. to get to the others.

Also you can stop the running script with ctrl+c.
0/0
 Reply   Quote More 

 From:  Manthorp   
 To:  Drew (X3N0PH0N)     
41672.81 In reply to 41672.79 
*\o/* *\o/* *\o/* *\o/* *\o/* *\o/*  (imarealboy)  (hug)

Thanks Xen, thanks Ant!!!

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951
 
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Manthorp      
41672.82 In reply to 41672.81 
(cheer)
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Manthorp      
41672.83 In reply to 41672.81 
I'm sure you won't want to touch this now for a while *but*...

You're running it on a virtual terminal now which is all good and that but you don't have much control over how it looks. You can set the font (from a very limited range of pixel fonts) and that's about it.

*If* you booted to a window manager and ran your script in a terminal within that you'd then be able to choose a nicer font (a ttf font), set up the colours and also (maybe more importantly) support any emoji people might use in their tweets (by installing symbola, should be in the repos) which can look quite nice on the terminal, like so.

I'd be happy to write you a config for i3 which launches a terminal fullscreen and runs your script.

 
0/0
 Reply   Quote More 

 From:  koswix  
 To:  Drew (X3N0PH0N)     
41672.84 In reply to 41672.83 
What that font?

 ▪                    
             ┌────┐    ┌────┐                      
          │    │    │    │ ▪                    
          │    └────┘    │                      
          │   ──┐  ┌──   │ ▪                    
   ┌──────┤    ▪    ▪    │                      
  ┌┘      │              │ ▪                    
┌─┤       └──┐  │  │  ┌──┘                      
│ │          │ ││  ││ │   ┌─┐                   
│ │          └─┼┤  └┴─┴───┘ │                   
│ │           ─┘│           │                   
│ │   ┌──────┐  └┬──────────┘                   
  │   │      │   │                              
  │   │      │   │                              
  └───┘      └───┘                              
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:  Drew (X3N0PH0N)  
 To:  koswix     
41672.85 In reply to 41672.84 
Ubuntu Mono. I really like the Ubuntu fonts.

(Tangentially related, Red Hat just released a libre font which is also rather nice)
0/0
 Reply   Quote More 

Reply to All  
 

1–20  21–40  41–60  61–80  81–100  101

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