List running services, Package name and status on AIX.

Hi,

How can I list running services, corresponding package name and status on the AIX host?
On Linux (Centos), I use the below code snippet:-

for i in `chkconfig --list | awk '{ print $1}'`; do
status=`/sbin/service $i status`
packagename=`rpm -qf /etc/init.d/$i`
done

Is there something of such sort we can do on AIX to retrieve exactly the same output? Please confirm and let me know of any pointers available (you guys may have).

Thanks in advance.

Hi,

there are no chkconfig for checking the status of all running services.

It depends which kind of software you use:
Open Source installed from the Linux Toolbox (RPM/self compiled) or
AIX Licensed Program Products (LLPs)

Services which installed via RPM or 'self compiled' normally reside under /etc/rc.d/init.d and can check in the similar manner you already do.

Example:

for SERVICE in `ls -1 /etc/rc.d/init.d/*`;do $SERVICE status;done

AIX Services can check with lssrc -a .
The corresponding LPP/Fileset you get with lslpp -w - it works like rpm -qf .

Other Services may start directly from the INIT-Deamon, so you could check the /etc/inittab file too.

Regards

As xray already said check with "lssrc". Services (which are called "subsystems" and "subservers") in AIX are controlled via the "System Resource Controller" (SRC), which knows these basic commands:

lssrc lists a (or all) subsystem(s) or group of subsystems and their status
startsrc starts a subsystem or group of subsystems
stopsrc stops a ssubsystem or group of subsystems
refresh restarts a subsystem or group of subsystems (yes, the naming is that intuitive)

There are also mkssys and rmssys to create and remove subsystems but i suggest to read a bit before trying to use these.

There is a genuine packaging system of its own in place in AIX - installp - although it can also use RPM. The command to list packages is lslpp . I suggest to see the man page of the command for details. Here are two options you might want to know:

lslpp -w /path/to/file tells you which package the specified file comes from

lslpp -f packagename tells which files/direcctories are part of a certain package.

I hope this helps.

bakunin