Set up logger(1) traps earlier to catch logfile setup failures
If /usr is mounted read-only, kernel relinking fails silently without any
log trace:
# /usr/libexec/reorder_kernel
/usr/libexec/reorder_kernel[35]: cannot create /usr/share/relink/kernel/GENERIC.MP/relink.log: Read-only file system
This stderr line does not show up anywhere because init(8) redirects stdout
and stderr to /dev/null, executes rc(8) which inherits it and thus executes
reorder_kernel with both streams discarded.
So install the error handler first, then try to set up a log file.
Introduce ERRMSG to provide error messages to users, i.e. not say
"see .../relink.log" when creating this file is what failed:
# ksh ./reorder_kernel.sh
./reorder_kernel.sh[40]: cannot create /usr/share/relink/kernel/GENERIC.MP/relink.log: Read-only file system
# tail -n1 /var/log/message # or xconsole(1)
Nov 7 10:51:00 eru reorder_kernel.sh: failed
OK tb