« Posts tagged detach

Staying attached to IRC

If you’re having trouble staying connected to IRC due to a poor Rogers connection, there are ways around it.

The best way to make sure you don’t miss any important messages is to create an IRC session on a remote server and bounce through it. The IRC session will stay connected as long as your remote server as well as the IRC server are both online. If your home internet connection goes down, the IRC session will stay connected and you will be automatically detached.

One way to do accomplish this is to use screen and a text-based IRC client such as irssi or epic5:

$ screen
[ ... Screen information window ... ]
$ irssi
[ ... Connecting to IRC and so on ... ]
[ ... blah blah blah ... ]
$ exit

The first thing I did there was create a new screen session. Typing screen without switches will display an information window and drop into a new shell. In here I ran irssi and connected to IRC, joined the channels and so on. At any point during my IRC session I can detach and my irssi client will still stay connected because the screen session is still active. If I kill my ssh connection it will not affect the IRC client’s connection to the IRC server, screen makes sure of that.

I can now come back at any time and from any machine and re-attach to the screen session created previously:

$ screen -dr

-d tells screen to force detach any lingering sessions, -r is to re-attach. This will bring me back to the irssi session I had before I detached. I hope I don’t have to mention not to run any of these as root…

There are other ways to accomplish the same thing, which allow you to use your GUI-based clients, mIRC/X-Chat. There are IRC proxies out there called BNCs or bouncers. They act as daemons that create a background session to the IRC server(s) of your choice and idle your nickname. You can then connect to the bouncer on the pre-configured port and it will relay messages from the IRC session to your client. If your connection to the bouncer is dropped, your IRC session will be maintained until you re-attach.



PS: for you S@Y students, matrix.* has irssi and screen ready to use.