Unix machines can be configured to always start the Journyx service as soon as the machine is rebooted. Typically this type of operation is performed by configuring a few commands in a system startup script such as rc.local on a Linux system.

This document gives guidelines on how that may be done. Journyx recommends that only personnel with solid experience in Unix system administration attempt this procedure.

First some background. When the Timesheet product is installed on Unix machines a cron entry is added in the installing user’s crontab to check the service and restart it if it is not running. The cron entry looks similar to this.

1,11,21,31,41,51 * * * *  /u/bob/s/jt/pi/bin/wtjob # Journyx Timesheet maintenance

While this is sufficient for most installations, some customers have wanted to make sure the service was started immediately on system reboot, rather than wait for the cron entry to fire. Additionally this script looks at an application configuration flag (HALTED) to try to determine if the site is eligible to be started. If the application is shut down with a wstop command, then the HALTED flag value is set to 1 to keep wtjob from restarting a site that was shut down for maintenance or other reasons. If the server is rebooted, the site will not restart due to the HALTED flag having been set. In normal operations, where the application is up when the server reboots or crashes, the HALTED flag is left with a 0 value, and the wtjob script will restart the site.

This document shows the commands necessary to start the service on machine startup in all cases and irrespective of the setting of the HALTED flag, and an example of how this can be configured in Linux. An experienced system administrator should be able to determine in which system startup file the commands best fit for a particular operating system and configuration.

In general, there is a simple line that needs to be executed as the installing user that will start the service. In all cases you first need to make sure you know the following things.

The name of the user that owns the jtime installation (the person under whose uid the product was installed and runs). We’ll refer to this user as the installing_user.

Where the installation is located. We’ll refer to this as jtime_home

Using these two pieces of information the following line can be executed at machine boot time from a system startup script.

su -c "cd jtime_home/pi/bin ;. ./setup;wstop;wstart" installing_user

Linux System example:

One place to put this on a Linux system is in the /etc/rc.d/rc.local file. We strongly suggest saving an unedited copy in some safe place in case the file needs to be restored to the original condition. You will need to edit this as root.

Place this line in the rc.local file. Make sure to confirm that the path takes you to the directory in the Timesheet install where the setup file is located. Also make sure to enter the line with all the period characters as indicated.

su -c "cd jtime_home/pi/bin ;. ./setup;wstop;wstart" installing_user

Installing_user and jtime_home must be substituted with the actual values.

Save the file, and schedule a reboot check to make sure the service is restarted on machine reboot.