-->
   
   

Can the simulator be started in the background or at Linux boot time?

          

The simulator can be started in the background enabling you to continue using the Linux shell environment while the simulator runs. There are two methods for doing this listed below. Depending on your version and flavour of Linux one or the other method may work better than the other.

First method for starting in the background (preferred)

screen has an advantage that you can reconnect to your console. Please read the screen manpage for further instructions on how to use screen.

The steps are:

  1. Ensure that screen is installed. Depending on your flavour of Linux this is either pre-installed or available for manual installation.
  2. Start the simulator in the background using screen. E.g.
    screen /sim/runsim.sh
  3. See the instructions below for automating this process at boot time.

Second method for starting in the background

The script bgrun.sh runs the runsim.sh script using expect to force the simulator to run in the background without any console access. Once the simulator has started you should only shut it down with a telnet/rsh into the simulator followed by a halt. In emergency situations you can kill the maytag.L process but this is not generally recommended.

You must not attempt to run the same simulator again either via bgrun.sh or via runsim.sh unless you are sure that the previous simulator has shut down. Check the .bglog log file in the simuator folder to see if it shut down and/or ps -ef | grep maytag to see if a simulator is running. If you are running multiple simulators you'll need to work out if your specific simulator is running by reading the top of the .bglog file for the ppid process and see if that bash process is running.

The steps are:

  1. Ensure that expect is installed. Depending on your flavour of Linux this is either pre-installed or available for manual installation.
  2. Get the simulator working and available on the network using the normal runsim.sh script.
  3. Test the simulator running in background with the bgrun.sh script.
  4. See the instructions below for automating this process at boot time.

Starting at boot time

The steps are:

  1. Create an entry in the /etc/init.d/ folder for the correct runlevel as root. Most Linux distributions use rc5.d (X display) or rc3.d (console only).
      linux:/etc/init.d/rc5.d # cat S99startsim
      cd /sim
      screen ./runsim.sh (or ./bgrun.sh depending on the method above chosen)
    linux:/etc/init.d/rc5.d #
  2. Reboot Linux.