When IBM added Linux integration to AIX v5, it called it “AIX 5L” to put special emphasis on the Linux integration part, so today I think that Linux v6 and above should be called AIX v6L+, since now we have at last YUM for AIX, eliminating the painful dependency hell caused by the RPM installations.
Jokes apart, IBM has done a great job porting YUM to AIX v6.1 and above, and now it’s really a breeze to install usual linux programs used in AIX servers, like sudo, gtar, logrotate, python, etc.
This is part of the effort that is currently being done in new technologies applied to the AIX universe, so an automatic package installer was needed, and yum was chosen.
But it doesn’t stop there with yum, as we also have python, perl, ruby, php, Node.JS, chef and other utilities and packages, so now we can build an AIX DevOps capable environment.
IBM announced all this in a december 2016 update, and it is a welcome addition to the AIX ecosystem, to bring it up to date with the latest IT tendencies.
If you want to find more about it, you couldn’t do worse that search on google for “yum on AIX pdf”, to get a couple of entries from IBM site.
The installation is quite simple, I have talked about it previously on my blog, but there’s plenty of info about it in IBM’s FTP site:
And once we have yum installed, then we can move on to more “juicy” things, like Logrotate on AIX, since apart from the syslog facility, which incorporates it’s own advanced log handling, we don’t have a log rotation facility in AIX, and it is something that is really missed in an OS that has been around for a while.
So, here we go with the first step:
1.- Install logrotate with yum
[root@aix72:/home/admin]yum install logrotate Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package logrotate.ppc 0:3.8.5-1 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================ Package Arch Version Repository Size ============================================================================ Installing: logrotate ppc 3.8.5-1 AIX_Toolbox 48 k Transaction Summary ============================================================================ Install 1 Package Total download size: 48 k Installed size: 113 k Is this ok [y/N]: y Downloading Packages: logrotate-3.8.5-1.aix6.1.ppc.rpm | 48 kB 00:00:00 Running Transaction Check Running Transaction Test Transaction Test Succeeded Running Transaction Installing : logrotate-3.8.5-1.ppc 1/1 Installed: logrotate.ppc 0:3.8.5-1
[root@aix72:/home/admin]logrotate logrotate 3.8.5 - Copyright (C) 1995-2001 Red Hat, Inc. This may be freely redistributed under the terms of the GNU Public License Usage: logrotate [-dfv?] [-d|--debug] [-f|--force] [-m|--mail=command] [-s|--state=statefile] [-v|--verbose] [--version] [-?|--help] [--usage] [OPTION...] <configfile>
OK, so we have installed logrotate, and as it is installed in /usr/bin, it can be invoked from anywhere, like the rest of the system’s external commands.
However, the logrotate package leaves the following files and directories in places where they are not expected to be in our AIX boxes:
[root@aix72:/etc/logrotate.d]ls -l /opt/freeware/etc/ total 8 drwxr-xr-x 2 root system 256 Nov 04 16:39 bash_completion.d drwxr-xr-x 2 root system 256 Feb 26 16:20 cron.daily -rw-r--r-- 1 root system 662 Jun 10 2013 logrotate.conf drwxr-xr-x 2 root system 256 Apr 14 2016 logrotate.d
So, we will have to copy them to where they are supposed to be: that way logrotate will work without modification of the config files, and also sysadmins that know logrotate will be able to use it without having to look all over the system for the config files.
[root@aix72:/home/admin]cd /opt/freeware/etc #copy the configuration file to /etc: [root@aix72:/opt/freeware/etc]cp -p logrotate.conf /etc/ #copy the configuration directory (and it's files) to /etc: [root@aix72:/opt/freeware/etc]cp -pr logrotate.d /etc/ [root@aix72:/opt/freeware/etc]cd cron.daily #copy the logrotate script to be invoked from crontab to /etc: [root@aix72:/opt/freeware/etc/cron.daily]cp -p logrotate /etc/ #NOTE: Not necessary, but a very good sysadmin practice for cases like this, is to update the timestamp on the files related: #update the modification time of all the logrotate files & dir's: [root@aix72:/opt/freeware/etc/cron.daily]cd /etc [root@aix72:/etc]touch logrotate logrotate.conf logrotate.d
Done, so now we can go the next step, to configure logrotate for our AIX system (To be continued…).