Jump to content
Sign in to follow this  
foldem

Start screen irssi on boot

Recommended Posts

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))

Share this post


Link to post
Share on other sites
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! :)

 

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.

Share this post


Link to post
Share on other sites

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

 

Edit your crontab with:

$ crontab -e

 

Then add this:

@reboot /usr/bin/screen irssi

Share this post


Link to post
Share on other sites

Some issues with screen can result in:

Must be connected to a terminal

 

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

% 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:

 

@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.

Share this post


Link to post
Share on other sites

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

 

@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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...