How To: List what Procs are using the Lib in Linux

LsOF

Find the Procs

After upgrading an important package in Linux -or other Unix variant- that provides a library used by many other processes. Instead of restarting the server for the new lib to take effect, the procs can be restarted -or HUPed- individually.

Before we begin, lsof needs to be installed.
# RHEL / CentOS
~$ yum install lsof

# Debian / Ubuntu
~$ apt-get install lsof

In the following example, we list what processes are using the libcrypto library in Raspbian.
~$ lsof /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 551 root mem REG 179,2 1418532 10074 /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
ntpd 2321 ntp mem REG 179,2 1418532 10074 /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
sshd 6643 root mem REG 179,2 1418532 10074 /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
sshd 6649 meow mem REG 179,2 1418532 10074 /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
openvpn 30044 nobody mem REG 179,2 1418532 10074 /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0

Next, the affected processes can be restarted:
~$ service [SERVICENAME] restart
~$ systemctl restart [SERVICENAME]
~$ kill -HUP 31337

Confessions of a SysOP – Linux Enthusiasm in the Enterprise Environment

Dell RHEL 6

I used to be highly enthusiastic about open and free information technology, and I still am to some extent, but the workplace made me think critically in a new way.

Ever since my first introduction to Linux a couple of years ago, running as a Knoppix Live DVD on my parents old HP 3GHz Pentium 4, I’ve had a constant buzz from all the quirky and cool features. It didn’t take long until I discovered and familiarized myself with the shell, and learned about it’s place in the operating system. How could I have missed this?

Soon thereafter, I gathered the courage to install it for the first time. This time on an old Packard Bell laptop. Ubuntu 6.04 was my system of choice at the time, and to this day I don’t regret it. I’ve always felt that Debian has a more Human touch.

Fast-forward a couple of years and I’m studying this marvelous OS, for two years, full time. My initial experience was nothing short of a technological enlightenment. Linux or not, *Nix systems have a very colorful history, and has always had ha place in IT infrastructure. Here, I was taught what Linux does best, in the elusive Enterprise Environment (that phrase still gives me chills).

Business critical server services such as DNS, SMTP, SQL, HTTP, NFS, FTP, Certificate signing and various applications hosted -on none other than- Linux. What else? Who wouldn’t?

Then came, the work environment. There I learned, the hard way, that not everyone is so understanding.

Why, for example, would the web-developer ask me to “chmod 777” every file in the application directory and “./start-crappyenterpriseapp.sh”, while running and owned by user root (!!!).

Or, perhaps, order a publicly accessible file server and emphasize on security. Noting that user directories should be chrooted and not be able to access each other, Challenge Accepted. Two weeks later: “Could we make it so that user A can read/write in the home-directories of users C, D and E? Also, could we use FTP instead of that pesky sFTP? It’s time-consuming emailing keys” (…).

How about, receiving the request: “Could we add the zone company.local to your public authoritative name server?  All our servers, internal and public, already use it as their primary DNS server. Adding a couple company.local sub-domains there would be a quick fix. Right?” (… no).

Never let them see you bleed.

Building Stuff In Ubuntu?

Are you finding it hard to find all of those necessary libraries when building your binaries in Ubuntu/Debian?? Well my friend, I’m here to help, apparently you can install all the necessary dependencies with the Ubuntu/Debian apt-get command (if off course the package is in the database, hihi), just type:

sudo apt-get build-dep <package>

And you should be fine, all of the necessary dependencies will be downloaded and installed.