Creating a Subsystem in AIX

Want a deamon to be controlled by the system resource controller?

Easy:

Create fksubsys service:

mkssys -p /path/to/fkcmd \ # Absolute path to subsystem bin or script
-a “arg1 arg2” \     # if Arguments to the command
-s fksubsys \        # Unique name for the subsystem (-t fkalias)
-G fkgrp \           # Subsys group
-u 202 \             # User id for the subsystem (0 for root)
-i /dev/console \    # Stdin got from (default)
-o /dev/console \    # Stdout sent to (default)
-e /dev/console \    # Stderr sent to (default)
-R \                 # Restart subsys if halted abnormally (or -O)
-Q \                 # One instance only # -q if multiple instances
-S \                 # Subsys supports signals
\                   # or -I msgqueue -m msgtype (or -K if sockets)
-f 9 \               # signal KILL for forced stopsrc -f
-n 15 \              # signal TERM for normal stopsrc
-w 10 \              # 10 seconds between a TERM and KILL & restart)
-E 24 \              # Subsys priority (20 default)
-d                   # lssrc -a lists subsys even if inactive else -D

lssrc -S -s fksubsys # Check the service’s configuration: OR…
odmget -q subsysname=fksubsys SRCsubsys # … via the odm.

startsrc -s fksubsys  # startsrc -g fkgrp  # two ways to launch it
stopsrc -s fksubsys # and to stop it

mkitab -i cron fkcmd:2:respawn:startsrc -s fksubsys # start subsys via /etc/inittab