How to display all daemon processes in priority order?

Hi,

Is there any way to run chkconfig --list and to display all daemon processes in PRIORITY order, not in alphabetic order?

Thank you.

command OS specific, moved to linux...

I don't believe there is a way to do this with the chkconfig command, but you could try listing and sorting the contents of the /etc/rc.d/rc.*d directories to create an ordered list by priority of the daemons. The below command uses find to list all the symbolic links to the daemons, grabs the daemon name, sorts them by priority, remove any duplicates, and finally present an ordered listing by priority. This just shows the startup daemons, to do the same with the shutdown process change the uppercase S to a K.

find /etc/rc.d/ -name 'S*' -type l | awk -F/ '{sub(/^S/,"",$5);print $5}' | sort -n | uniq | sed 's/^[0-9][0-9]/& /g'

Produces a list like so:
01 reboot
01 sysstat
02 lvm2-monitor
08 ip6tables
08 iptables
10 network
11 auditd
11 portreserve
12 rsyslog
13 cpuspeed
13 irqbalance
13 rpcbind
14 nfslock
15 mdmonitor
18 rpcidmapd
19 rpcgssd
20 kdump
1 Like

I don't believe that you can do that, I've checked the man pages and haven't found anything.

1 Like

And what exactly do you mean by "priority order"?

1 Like