Timeout on a script or program in Linux is easy! Did you ever have the need to kill a process if it takes too long to run for any reason? Then this post will show you how you do just that.
This could be used to prevent a cronjob for running too long or prevent cronjobs from overlapping if a lock-file is not the optimal solution in your case. It could also be used in a case where a process freezes for unknown reasons, and you need to force a restart of it based on a how long it has been running for.
This is not just useful for cronjobs, it can set a timeout on any process, script or program you run!
You may have experienced it before, you create a cronjob to change some data every X hour or minutes and one day this job takes longer than it usually does and cron spawns another job before the first one is finished.
This can result in data corruption or deletion of data that should not have been deleted, all depending on what the cronjob is set up to do
To prevent bad things from happening, a good rule of thumb is to always use a lockfile
A lockfile is a small file, it virtually takes up no space, at least so little you won’t care (The actual size depends on your filesystem). Sometimes it contains a PID, sometimes a timestamp or just plain empty. Depending on how the lockfile is managed Continue reading →
We only use HP servers and we get more and more every week. Someone has to keep track of all those servers and be able to configure them using iLO in case of a disaster
Installation almost runs automatically, except for iLO configuration.
I have to first find the iLO ip, then login to the web interface, create users, set static IP and what not. It takes time, a lot of it.
If only there was some way to automate it without having to use HP’s software.. but wait, THERE IS!
I already posted how to scan for all HP ILO devices in your subnet, but the basics in the following post on how to configure iLO from your guest Linux OS might make everything a little easier for the sysadmins out there
How to configure HP iLO in Linux
First I will show you the useful commands and an example output for each, and then how to automate the configuration of your HP iLO interface using bash scripting
The script for configuring iLO automatically will be included at the end of this post
OpenIPMI OpenIPMI-libs OpenIPMI-tools
These packages can be installed through your favorite package manager, below you’ll see the defaults in Debian and CentOS/RHEL
Today I had to run a script on a 64Bit server, but was met with the following error:
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
Reason for the /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory error
The /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory error will happen only on 64 bit systems, the cause is the that 32 bit libraries are missing from the system and the script/program needs them, so it can’t run.
How to fix the /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory error