Linux-Noob Forums
Start screen irssi on boot - Printable Version

+- Linux-Noob Forums (https://www.linux-noob.com/forums)
+-- Forum: Linux Noob (https://www.linux-noob.com/forums/forum-3.html)
+--- Forum: How Do I? (https://www.linux-noob.com/forums/forum-60.html)
+--- Thread: Start screen irssi on boot (/thread-1854.html)



Start screen irssi on boot - foldem - 2006-08-13


I've been using screen + irssi for a while now (ssh from work to home :)), but in the last weeks I have had to deal with some power outages. So I have been wondering a couple of things

 

1. how do I start screen and irssi as a certain user on boot.

 

2. how do I configure that the pc starts back up when the poser returns (prolly A bios option but don't wanna reboot it (great uptime now :P))




Start screen irssi on boot - znx - 2006-08-14


Quote:1. how do I start screen and irssi as a certain user on boot.
 

Certainly it is possible. In fact I use it! I used this source here. This requires a utility called "start-stop-daemon". If you don't have that then you can download this and compile it but most system have it now a days.

 

Any issues just as me! :)

 

Quote:2. how do I configure that the pc starts back up when the poser returns (prolly A bios option but don't wanna reboot it (great uptime now :P))
 

Yeah has to be a bios option, look for power options, particular restart on power loss .. etc.




Start screen irssi on boot - znx - 2008-01-06


Another possibility is to use cron which has the nice @reboot option.

 

Edit your crontab with:



Code:
$ crontab -e




 

Then add this:



Code:
@reboot /usr/bin/screen irssi







Start screen irssi on boot - znx - 2008-01-06


Some issues with screen can result in:

Quote:Must be connected to a terminal
 

So one work around that I have figured out is this:



Code:
% ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mark/.ssh/id_rsa): /home/mark/.ssh/id_localhost
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mark/.ssh/id_localhost.
Your public key has been saved in /home/mark/.ssh/id_localhost.pub.
The key fingerprint is:
7c:63:29:a2:ae:08:ed:8b:ff:15:63:1a:7e:9f:14:22 mark@tone
% cat /home/mark/.ssh/id_localhost.pub /home/mark/.ssh/authorized_keys >tempfile
% mv tempfile /home/mark/.ssh/authorized_keys
mv: overwrite `/home/mark/.ssh/authorized_keys'? y
% vi .ssh/config
(add this into the file)
Host lo
HostKeyAlias localhost
HostName localhost
IdentityFile /home/mark/.ssh/id_localhost
User mark
Port 22
(save the file)
% ssh lo
Last login: Sat Jan  5 14:47:41 2008
% exit
Connection to localhost closed.




 

Now we have a working connection to localhost. So what we want in our crontab is this:

 



Code:
@reboot ssh lo screen -d -m irssi




 

Tada .. work around complete. You might need to make the public key entry under root's account if you use the global crontab.




Start screen irssi on boot - rooster - 2008-01-09


So, ZNX and I couldn't get this working at all. Something was preventing my machine from accepting the public keys. Well here is the fix I finally found, hours later.

I added the following line to my users crontab with crontab -e

 



Code:
@reboot /usr/bin/screen -d -m irssi




 

We had tried this as @reboot /usr/bin/screen irssi, which did not work.

Hope this helps someone cause I know I found very little helpful info from my searches online




Start screen irssi on boot - znx - 2008-01-12

Why the heck didn't I try that first .. heh anyway!