« Last two weekends - nagios and more cfengine 2 & 3Ubuntu squid with SSL »

Moving irssi

07/14/13

  05:58:00 pm, by The Dreamer   , 2452 words  
Categories: Software, Ubuntu, FreeBSD, CFEngine

Moving irssi

So, recently there was a 'long' 4th of July weekend....on account that I opted to take Friday (the 5th) off as well.

I kind of thought I would tackle a bunch of different projects this weekend, though I've pretty much shelved the idea of re-IP'ng my home network. Perhaps something to do when I get my configuration management better fleshed out.

What I decided was that it looks like its just one last thing on one of the two Ubuntu servers that I'm retiring. So, I figured I'd quickly move that and then go onto the next thing. In the end, I didn't get it completed until Monday night.

For background, some years back...after my return to IRC, I had initially gone with Chatzilla (being that Firefox was my standard browser), which later moved to xulrunner and Chatzilla so it was independent of my browser. Though it was kind of annoying having it running at work and at home, and somewhat confusing for co-workers that ran text based IRC clients in screen somewhere and ssh'd in, etc. Most people that did this, were doing irssi.

So, I initially built it from source and was running on my old RedHat 7.3 server, and that was usable. Later when I setup an Ubuntu box to replace that server (the hardware had previously been SuSE....acting as an internal router for ivs status tracking....) It evolved, in that I would start screen detached from rc.local....which was important since the system would see patches on a regular basis, requiring reboots....which is kind of a reason for switching to FreeBSD.

Over time, I would make little tweaks here and there, to this irssi setup. Like twirssi, doing ssl, and later bitlbee to integrate Facebook chat (came across some stuff that I should add now...)

And, incorporating other tweaks I come across online when there's some problem that becomes sufficient bothersome that I want to address. The one problem I haven't haven't been able to solve is keeping server/system messages confined to the one window. Namely keeping system CRAP going to the system window, and allow channel CRAP to show up in the channel windows....but instead I'll get system CRAP in whatever channel window is active. Which is annoying because its usually the work channel. Where it be just signal and no noise.

Anyways...

I had started to move things more than a month ago, in that I built irssi and bitlbee (including the cfengine3 promise for it...not really much config wise for cfengine to manage for irssi...though I envisioned promising that its running all the time, though irssi has generally been stable everywhere else that I've run it.

But, the I got distracted by other cfengine3 work. Even though things started to get pressing when twirssi stopped working, due to API 1.0 going away...so I had to update Net::Twitter and twirssi. Updating twirssi wasn't that hard to do, but Net::Twitter was a problem, so I opted to remove it and its dependencies and then installing it and its dependencies using CPAN.

I also made note to install net/p5-Net-Twitter from ports on dbox.

twirssi seems to be having other issues, which I had intended to investigate...perhaps after I move... But, that was like a month ago....

But, then I concluded that the last thing holding up the end of 'box', was irssi so I figured I'd find a quiet time during the 'long' weekend and move irssi.

So, finding a quiet time, I shutdown irssi, rsync'd everything over, and started it backup....unfortunately, it wasn't that simple.

When I attached to the new irssi, it was a jumbled monochrome mess with apparently black on black portions. I spent a bunch of time trying to figure out why colors weren't working. Using /set term_force_colors ON
Unfortunately, it wasn't that simple. There were also a lot of angry scripts. Guess I need to trackdown the dependencies for those. I was able to find all of them in ports, except for WWW::Shorten::Yourls, even though just about every other WWW::Shorten::*service* port existed and Yourls is also in ports (www/yourls).

In trying to be quick, I resolved this problem by resorting to CPAN.

At first I kept switching back and forth, then I tried running it in a regular terminal session with no config/themes...well that worked. But, nothing different between stock and my setup to explain the difference. Occurs to me that I can just leave irssi running on 'box' while I continue to work on this...doesn't hurt to be signed in twice, except for twirssi as it puts me over the API limits.

I notice that when I start irssi in an attached screen versus a detached screen:

Shell

screen -/home/lchen/.screen.irssi -dmUS irc

vs.

Shell

screen -/home/lchen/.screen.irssi -US irc

That not only does term colors work correctly, but my split window sizes come out right. I had been saving/playing many times over the years trying to get the sizes to stick right, but they never worked...though it wasn't bad enough to be an issue.

Eventually conclude that there's something in irssi's initialization that it needs a real xterm (gnome-terminal on zen) to decide what its capabilities are, instead of just screen's emulation. Though now that I think some more....it could be that while Ubuntu server 'box' didn't have X (initially) it wasn't headless...so it probably could use the video console, though that doesnt' make sense, because while 'dbox' is truly headless, it still has a video console....I just don't have anything connected to it normally. Though I had once when I was stuck, and later when I was testing my IP-KVM unit.

:hmm:

Anyways...guess I'll have to settle on ugly and find a way to have an xterm on a headless FreeBSD server.

Back in the day when I had my first headless Solaris box to deal with, I had used Xvnc...(inorder to install Oracle) in fact this is how things are done at my current place of work. But, I couldn't find Xvnc in ports. It appears that it's been deprecated, in favor of Xvfb (and x11vnc. Well, I didn't need the vnc part.) So, I launch the build of Xvfb, aka x11-servers/xorg-vfbserver, and then follow it with a build of x11/xterm.

So, now instead of:

Shell

/usr/local/bin/sudo --u lchen screen -/home/lchen/.screenrc.irssi -dmUS irc

in /etc/rc.local, I have:

Shell

/usr/local/bin/Xvfb :-fbdir /var/fb > /dev/null 2>&&
 
at now 1 minute << EOF
/usr/local/bin/sudo --u lchen /usr/local/bin/xterm -geometry 132x45 -display :-bg black -fg white -e screen -/home/lchen/.screenrc.irssi -DRUS irc &
EOF

I thought about then having it detach and closing Xvfb, but that would then complicate how to reset the irssi screen environment. Either due to doing something that causes it to crash, or to switch to irssi configuration that uses other gateway...which only changes the gateway for the irssi side, twirssi and bitlbee don't switch....though its the irssi part that's important. I suppose if really wanted it right...I would have some way to switch between running this irssi mess on either dbox or cbox depending on which gateway I want, etc. Perhaps a future project.

The '-fbdir' option can probably go away, since it was for testing to see that things were working right on the Xvfb. Plus it added some complexity by needing the share /var/fb to 'zen' so that I could view the framebuffer file.

Also it turns out that Xvfb doesn't consume all that much memory.... according to top, SIZE is ~ 64700K and RES is ~ 5512K. There is more than a screen full sorting by SIZE or RES above Xvfb, so dbox doesn't seem to be hurting for memory.

Though while I was researching having irssi autostart, I had come across pointers to stopping as well... so I created an /etc/rc.shutdown.local with this command:

Shell

/usr/local/bin/sudo --u lchen /usr/local/bin/screen -S irc -p 0 -eval 'stuff "\025//quit\015"'

This isn't the same string that I had found on other places (namely here), because I apparently couldn't inject CR the same way as Linux. So, with some trial and error, I found a way that would work. Though this particular incarnation hasn't been tested. It adds directing the injected input to window 0, since I've been know to open another window to read backlog or fiddle with scripts and/or configs/themes. Though wonder if that's a security risk, since I've gone to multi-attach by default now. &#58;&#108;&#97;&#108;&#97;&#108;&#97;&#58; First code will hopefully clear anything that might be entered....

Finally there was one last stumbling block....why was irssi showing the channel key now?

Pages: 1·

No feedback yet

Now instead of subjecting some poor random forum to a long rambling thought, I will try to consolidate those things into this blog where they can be more easily ignored profess to be collected thoughts from my mind.

Latest Poopli Updaters -- http://lkc.me/poop

bloglovin

There are 20 years 5 months 27 days 1 hour 21 minutes and 45 seconds until the end of time.
And, it has been 4 years 7 months 1 day 12 hours 41 minutes and 11 seconds since The Doctor saved us all from the end of the World!

Search

July 2017
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Google

Linkblog

  XML Feeds

Who's Online?

  • Guest Users: 35
This seal is issued to lawrencechen.net by StopTheHacker Inc.
blog tool

hosted by
Green Web Hosting! This site hosted by DreamHost.

monitored by
Monitored by eXternalTest
SiteUptime Web Site Monitoring Service
website uptime