Hey there!


Handling OOM issues gracefully on linux

I figured out that there is almost no simple way to handle situation when your system is running out of memory. There is a subsystem called OOM killer implemented in the kernel, but that thing is truly dangerous. You probably never want to get your system to point when it is being used, because it might leave the system in unusable state.

For this reason I created a tool that allows everyone who uses linux to handle this kind of situation gracefully, it’s called terminator daemon, and it watches the system and eventually kills specific kinds of processes, which can be easily defined by an administrator.

You can find more about this tool on https://github.com/benapetr/terminator

Basic idea is, that when your system is running out of memory, this daemon will pick processes that can be “safely” killed without any impact on system and takes them out according to your settings. You can even prevent it from killing certain processes, for example: If you were running mysql server, you probably wouldn’t care about interactive shells being killed, but you would care if mysql was killed.

In such situation you can tell terminatord to never kill mysql, but other “user processes” can be safely killed.

In addition you can even set terminatord to execute some command on every kill, for example it can send you a mail that something wrong is going on with your system.

There are several examples on GitHub, here I copy pasted some of them:

Kill all processes that use more than 400mb of ram, except for user apache and root

Kill random processes in case that system has less than 100mb of free ram, except for root

Combine both examples, in this example unlike the previous one, apache processes will not be killed, when system go OOM




Installing oracle 11i (12c) on debian sid (6.0)

Somehow it happened that I decided to try out oracle on latest linux kernel and debian system.

I horribly failed.

In order to make you not fail, here is a guide what to do in order to install it

1. Install necessary packages

This is probably not needed:
2. Update /dev/shm

Oracle requires shared pool to be present there, but latest linux is using /run/ to store it – this is dangerous and you should reboot your server once you finish (you only need to do that if /dev/shm points to /run/shm)


3. Change the system limits

Write the following options to the /etc/security/limits.confce file:

Add the following to /etc/pam.d/login to validate parameters /etc/security/limits.conf:

Make sure you have this in your /etc/sysctl.conf file:

4. Change some more links

5. Create user credentials

6. Change dash to bash

Now you can install oracle using their universal installer. If you don’t have GUI, you need to create a response file. Don’t forget to bypass system checks, because the version of libraries used by debian is too new for oracle




About me

Hi all,

So I decided to start writing some interesting articles occasionally, and this one is my first, so I will introduce myself a bit.

My name is Petr Bena, I am an open source developer and in real life I work as a sysadmin.

I am heavily involved in wikimedia project, where I serve as a “community  developer” (non-paid guy who is helping out with many software projects) and I am also volunteering on many other wikimedia projects.

Beside wikimedia, I am working on Pidgeon – open source irc client which I decided to create because I just couldn’t find a good cross-platform irc client 🙂

If you want to find out more personal information about me, have a look on this wikipedia page:

http://en.wikipedia.org/wiki/User:Petrb

If you are lazy to click the link, here you have some personal information:

I live in Europe, I like coca-cola and czech beer. I don’t like czech politicians. I have 1 cat and 2 tomcats 🙂 and I like them more than they like me. And the most important thing – I like star wars (who doesn’t? :P)

Thank you for reading my blog