How To Install hatools on Fedora 34

hatools is Improved shell scripting in High Availability environment

Introduction

In this tutorial we learn how to install hatools on Fedora 34.

What is hatools

The HA-Tools provide some programs to improve shell scripting in a High Availability environment. The halockrun program provides a simple and reliable way to implement a locking in shell scripts. A typical usage for halockrun is to prevent cronjobs to run simultanously. halockrun uses a lock on a file via fcntl(2) which ensures the release of the lock even if the process gets killed via SIGKILL. The hatimerun program provides a time-out mechanism which can be used from shell scripts.

We can use yum or dnf to install hatools on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install hatools.

Install hatools on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install hatools using dnf by running the following command:

sudo dnf -y install hatools

Install hatools on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install hatools using yum by running the following command:

sudo yum -y install hatools

How To Uninstall hatools on Fedora 34

To uninstall only the hatools package we can use the following command:

sudo dnf remove hatools

hatools Package Contents on Fedora 34

/usr/bin/halockrun
/usr/bin/hatimerun
/usr/lib/.build-id
/usr/lib/.build-id/08
/usr/lib/.build-id/08/5d41e953d48224a39e6cea25b0591aab25f085
/usr/lib/.build-id/32
/usr/lib/.build-id/32/62b0ca9f698f889dc6643825ac0c0d8e81732d
/usr/share/doc/hatools
/usr/share/doc/hatools/AUTHORS
/usr/share/doc/hatools/COPYING
/usr/share/doc/hatools/ChangeLog
/usr/share/doc/hatools/NEWS
/usr/share/doc/hatools/README
/usr/share/man/man1/halockrun.1.gz
/usr/share/man/man1/hatimerun.1.gz

References

Summary

In this tutorial we learn how to install hatools on Fedora 34 using yum and dnf.