Weird reboot problem

The server I set up yesterday had a another weird problem. If you want to reboot the server after working several hours, the server just hangs and doesn’t shutdown properly. So today I took a closer look and now problem is gone but I’m not quite sure what was wrong.

I disabled some Bios options and in the end I plugged of the monitor. It’s really weird, because the reboot works properly if you turn the server on and reboot it right after it’s completely booted. If you work for some hours and try to reboot it then, it won’t work.

I also removed the grub boot options “rhgb” and “quiet” in the kernel line, that removes the splashscreen from the boot process, to see what’s going on.

Anyway, I’m glad the problem is gone.

There is also a forum entry where the problem sounds similar to mine: http://epis.ch/dc

tmux – screen like terminal multiplexer

I used screen for a while now and really liked it, but I could never remember how to use the split screen windows, so I just kept using the simplest screen commands.

– create, close window
– switch windows
– detach and reattach

But then Derek told me about tmux. I tried it with this YouTube Howto Video:

How to use tmux (the terminal multiplexer)

It’s really easy and with this short .tmux.conf that Derek sent to me, the basic controls are even similar to screen.

# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window

So, here the basic commands and what they do!

C-a - basic prefix for commands
C-a c - create new normal window
C-a " - create new split screen window
C-a SPACE - change split screen layout
C-a ARROWKEYS - switch between the split screens
C-a C-a - switch between normal windows, NOT the split screens
C-a 0-9 - switch to the specific window, NOT the split screens
C-a q - show the number of the split screens in the active window
C-a d - detach active tmux session

Show all active tmux sessions

tmux list-sessions
0: 2 windows (created Mon Nov  7 09:58:42 2011) [177x52]
1: 2 windows (created Mon Nov  7 13:16:07 2011) [177x52]

Re-attach to a specific tmux session

tmux attach -t 0

Howto use the CentOS Firewall/iptables

Actually the implementation of iptables is easier to handle on CentOS, compared to Debian.

They created three small scripts, that makes it quite easy to handle.

iptables-save
iptables-restore
service iptables save

Of course you still use the usual iptables syntax like this:

iptables -A INPUT -p tcp -s 192.168.0.0/24 --dport 22 -j ACCEPT

After you added some rules, you simply can export your iptables config:

iptables-save > firewall.txt

It will look similar to this one:

# Generated by iptables-save v1.4.7 on Mon Nov  7 12:11:59 2011
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [23:6016]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Nov  7 12:11:59 2011

Just add, change or delete rules and re-import the file!

iptables-restore < firewall.txt

Try if the configuration is working and if you want to keep it on the next reboot just type:

//UPDATE:
Oh there was a little mistake in the code. In addition, today I had a problem with the new installed CentOS 6, where the restore command didn’t work properly, because not all the rules were applied. For that I figured out I had to update the system with a simple “yum update”. Seems like there was a corrupt package on my install CD.

service iptables save

Thx, to Derek for the explanations.

Search for Perl modules with yum

I was about to install OTRS on a CentOS6 and for this I have to install several Perl modules. It’s always annoying to find the right packages for this, so I asked Google and found this pretty possibility to search for Perl modules directly in yum.

For example:

yum provides "perl(XML::Parser)"

The output would be:

Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: mirror.its.sfu.ca
 * epel: linux.mirrors.es.net
 * extras: mirror.its.sfu.ca
 * rpmforge: fr2.rpmfind.net
 * updates: mirror.its.sfu.ca
perl-XML-Parser-2.36-7.el6.i686 : Perl module for parsing XML files
Repo        : base
Matched from:
Other       : perl(XML::Parser)

Really nice!

Diary Update # 14 First week of Internship

Hey there,

i finished my first week of the internship and I like it. =) There are very nice co-workers and my tasks hopefully will be more related to server administration in the next weeks. This week I started with creating diagrams about the ethernet network in the server room and also of the power connections. Next steps will be a new or updated kind of server inventory. I’m really looking forward to the next weeks and my tasks, I’ll keep you updated for all the interesting things 🙂

Topic change!

Have you ever heard about “Poutine”?

Than take a look here:

German:
http://de.wikipedia.org/wiki/Poutine
English:
http://en.wikipedia.org/wiki/Poutine

It’s awesome 😀 so if you ever come to Canada or especially Vancouver. Try Poutine! So far I can recommend the one at the Donnelly’s Pub Chain, like “Cinema Public House” at Granville and Smithe Street, or the “Fritz” store at Granville and Drake Street. Don’t try the Poutine at A&W, because there you really should try the Hamburgers and not the Poutine 😀

See you! 🙂

Diary Update # 13 Last Day At ILAC!

Hey guys,

long time no see 🙂 – Some new information from my stay in Vancouver, Canada!
I’m here for 8 weeks now and I successfully completed the first part of my stay, the ILAC language school.

Yesterday was my last day of school in ILAC – It was perfectly timed, ILAC had the Halloween Party on the SAME!!! day. So class ended at 11:45am and at 12 noon the Halloween Party started and at 2:15pm they started the graduation ceremony, where I got my certificate. I’ll add photos of it later!

Later that same day we went to the SKYTRAIN HALLOWEEN PARTY!

See the video and some photos here: http://epis.ch/ct

Next week I start with the internship programm at pro.NET a web design, development and hosting company.

Stay tuned for new information! I hope I can write more often and with less text 😉