Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Sep 27 '11 at 13:06

This question came from our site for professional and enthusiast programmers.

    
What version of Solaris? –  Martin Carpenter Sep 27 '11 at 11:48
add comment

3 Answers 3

To see all the filesystem related services that start by default in Solaris 10 and newer, run:

svcs \*filesystem\*

This will return output like:

STATE          STIME    FMRI
online         Jun_11   svc:/system/filesystem/root:default
online         Jun_11   svc:/system/filesystem/usr:default
online         Jun_11   svc:/system/filesystem/minimal:default
online         Jun_11   svc:/system/filesystem/local:default
online         Jun_11   svc:/system/filesystem/autofs:default

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.

svcprop -p start/exec svc:/system/filesystem/usr:default

Shows us the method script that's used for this service.

/lib/svc/method/fs-usr

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.