FAQ: Running Sawmill at System Startup


Can I set up Sawmill to start automatically when the computer starts up?

Short Answer

Yes; run it as a Service on Windows; use StartupItems under MacOS X; use the /etc/rc.d mechanism on UNIX systems that support it.

Long Answer

Sawmill can be configured to run at startup in the same way any other program can, and the exact method depends on your operating system. Here's how:

On Windows:

Sawmill is automatically installed as a Service, and will be running as soon as installation is complete. The Service is set to automatically start when the system starts up. You can edit Service parameters, for instance to have it run as a different user, or to have it start manually, in the Services control panel.

On MacOS X:

  1. Install Sawmill in its default location at /Applications/Sawmill.

  2. If the folder /Library/StartupItems does not exist, create it.

  3. Copy the Sawmill folder from /Applications/Sawmill/Startup to /Library/StartupItems.
On RedHat 9 Linux or later:

Do the following as root:

  1. Move the sawmilld file from the Extras/RH9 directory of your Sawmill installation, to /etc/rc.d/init.d. Type

    chkconfig --add sawmilld
    chkconfig --level 2345 sawmilld on

    to install it and specify the run levels.

  2. Rename the Sawmill executable to sawmill (or change the name of the executable in the script) and put it in /etc/sawmill.

  3. Put a symbolic link to LogAnalysisInfo in /etc/sawmill/LogAnalysisInfo (or you can put the actual directory there), using the ln -s command, e.g.

    ln -s /usr/home/sawmill/LogAnalysisInfo /etc/sawmill/Log
    AnalysisInfo

    (you'll need to create the directory /etc/sawmill first).

  4. Start the service, e.g.

    service sawmilld start

On Ubuntu:

Do the following as root:

  1. Move the sawmilld file from the Extras/RH9 directory of your Sawmill installation, to /etc/init.d.

  2. Edit the sawmilld file and change the SAWMILL= line to point to the location of the sawmill binary (in the directory created by untarring the distribution file).

  3. Type:

    /usr/sbin/update-rc.d -f sawmilld defaults

    to to set it up to start/stop automatically.

On other Linux or other UNIX-type operating system:

  1. Install a script to start Sawmill in /etc/rc.d (or /etc/init.d, or however your UNIX variant does it). A sample script, based on the Apache script, is available here. The method varies from UNIX to UNIX, but to give one specific example, in RedHat Linux 7.0 you should call the script sawmilld and put it in /etc/rc.d/init.d, and then make symbolic links to it from the rc0.d - rc6.d directories, encoding into the name of the link whether to Start sawmill at that runlevel, or to Kill it. A good sequence of links is the following:

      ln -s /etc/rc.d/init.d/sawmilld /etc/rc.d/rc0.d/K15sawmilld
      ln -s /etc/rc.d/init.d/sawmilld /etc/rc.d/rc1.d/K15sawmilld
      ln -s /etc/rc.d/init.d/sawmilld /etc/rc.d/rc2.d/K15sawmilld
      ln -s /etc/rc.d/init.d/sawmilld /etc/rc.d/rc3.d/S85sawmilld
      ln -s /etc/rc.d/init.d/sawmilld /etc/rc.d/rc4.d/S85sawmilld
      ln -s /etc/rc.d/init.d/sawmilld /etc/rc.d/rc5.d/S85sawmilld
      ln -s /etc/rc.d/init.d/sawmilld /etc/rc.d/rc6.d/K15sawmilld
    
    If you're not sure where to put the Sawmill links or what to call them, and you have Apache installed on your system, look for files with names containing httpd in /etc/rc.d or /etc/init.d, and use the same names and locations for Sawmill, replacing httpd with sawmilld.

  2. Rename the Sawmill executable to sawmilld (or change the name of the executable in the script) and put it in /bin or somewhere else in your default path.

  3. Put a symbolic link to LogAnalysisInfo in /etc/sawmill/LogAnalysisInfo (or you can put the actual directory there), using the ln -s command, e.g. ln -s /usr/home/sawmill/LogAnalysisInfo /etc/sawmill/LogAnalysisInfo (you'll need to create the directory /etc/sawmill first).