NetApp: Quick and dirty way to start the simulator at system startup

Being a primarily NetApp shop I do a fair amount of testing against their simulator before using any of the perl (and slowly PoSH) scripts against production systems. One of the things that I did a while ago was create a simple way of having the simulator(s) start when my virtual machine starts so that I don’t have to worry about logging in to start it.

NetApp’s documentation for the simulator states two ways of having it start when the server does: using screen to start it in the background, and the more “brute force” method of simply backgrounding the process when it’s started (by appending an ampersand to the end of the command). While both of these methods work, I wanted a way that I didn’t have to login to the system first in order to access the console of the simulator.

All of this work refers to RHEL/CentOS 5.x, I haven’t tested it on any other OS, so I can’t vouch for it working. This isn’t pretty, as it kind of breaks security by having root autologin and start an application. That being said, you should ONLY ever use this in a controlled environment….such as VMware Workstation where you can limit the networking to a private network.

I am assuming you know how to install the simulator. I’m also assuming that it has been installed, and proven to be working on your system, previous to any of these steps being taken.

First thing that we’re going to want to do is disable the GUI. Don’t worry, it will still work, we just don’t need it, so why have it take up resources…this is a virtual machine after all and resources are precious. We do this by editing the /etc/inittab file to change the default run level.

We need to do another edit of the inittab in a moment though, so don’t wander too far. Another one of the configuration items that is stored in the inittab are what get’s started on each of the ttys that the system creates during bootup. We are going to modify two of the ttys so that they will automatically log in the root user.

The final step is to modify root’s bashrc so that it checks which tty it’s being executed from, and if it’s one of our two that will have a NetApp Simulator interface it starts the simulator.

Note that you may have to change the path to the runsim.sh scripts if you changed it during the install process.

Once that’s done all you should have to do is reboot your system. When it returns to the login prompt (no Gnome/KDE login this time) press ALT+F2 or ALT+F3 to switch to one of the other consoles that should have a Simulator starting/started on it. If you need to start the GUI for anything in the future, just log into tty1 (ALT+F1) and execute the command startx. Alternatively, after logging in, move the runlevel up to 5 using init 5.

Good luck, let me know in the comments if something doesn’t work for you.

Leave a Reply