Is there any way of seeing a list of commands that were run at startup/boot on Solaris?
I know there is a network drive being mounted at startup but I wanted to see the exact 'mount ...' command being used.
migrated from stackoverflow.com Sep 27 '11 at 13:06
This question came from our site for professional and enthusiast programmers.
To see all the filesystem related services that start by default in Solaris 10 and newer, run:
This will return output like:
To see how the any particular filesystem service is mounting it's filesystems, you need to look at the start/exec service property for that service.
For example, let's look at the /usr filesystem.
Shows us the method script that's used for this service.
Reading that script will show you that a 'mountfs' command is being used to mount the /usr filesystem. Looking at the top of the method script, you can see that /lib/svc/share/fs_include.sh is being included. Inspecting that file reveals a shell function called mountfs, that standardizes options being passed to /sbin/mount.
By understanding SMF, and the interactions between services and dependencies, you can get a deeper understanding of what your system is actually doing, and how tasks are accomplished.
Answering to the title question:
Yes, you can do that easily if you are running Solaris 10 or newer. Just use an anonymous dtrace script that will log every exec call starting from boot.
See that blog for an example: http://alexeremin.blogspot.com/2009/01/boot-chart-with-help-of-dtrace-and.html
You will need to modify that script for it to display the parameters passed to exec.
Maybe you should have a look at Chapter 28 - Mounting and Unmounting File Systems (Tasks) from the System Administration Guide, Volume 1.