How To Measure Linux Filesystem I/O Performance With iozone

Posted on in Categories File system, High performance computing, Linux, Linux distribution, RedHat/Fedora Linux, Storage, Sys admin, Tips, UNIX last updated July 4, 2008

IOzone is a filesystem benchmark tool. The benchmark generates and measures a variety of file operations. Iozone has been ported to many systems and runs under many operating systems including Windows, UNIX, Linux and BSD. This article gives you a jumpstart on performing benchmark on filesystem using iozone a free Filesystem Benchmark utility under Linux.

Find out if service / server running in chrooted jail or not under Linux

Posted on in Categories Howto, Linux, Sys admin, Tips last updated September 10, 2007

Chrooted jail allows run command or service such as http / mysql / postfix with special root directory i.e. chroot changes the root directory for application. The biggest benefit is a service that is re-rooted to another directory cannot access files outside that directory. Basically you are going to set service in sandbox. Chrooting offers the following 2 benefits:

[a] Service Isolation

[b] Privilege Separation

But how do you find out if service / server is chrooted or not under Linux?

Simply run ls -ld command on /proc/MAIN-PID/root directory.

For example, find out if httpd chrooted or not:
pidof httpd
Output:

23456

Run ls command:
ls -ld /proc/23456/root
Output:

lrwxrwxrwx 1 root root 0 Sep 10 02:52 /proc/23456/root -> /wwwdata

Find out if postfix is chrooted or not (PID 4645):
ls -ld /proc/4645/root
Output:
lrwxrwxrwx 1 root root 0 Sep 10 02:59 /proc/4645/root -> /
The PID 4645 pointing out to / (root) i.e. the root directory for application is not changed or chrooted. This is a quick and dirty way to find out if application is chrooted or not w/o opening configuration files.