Technical information
EVENT NOTIFY PROCEDURES
117
$1 is the Numerical Process ID (PID) of the scheduler.
Tip
If the sys-start script exits with a non-zero exit code, the server will shut down. This allows you to make special
checks and ensure that the server will not run unless your criteria are met.
Examples for Unix and Linux platforms
The following sample scripts run on Unix and Linux platforms only (not on Windows platforms).
Below is a sample start Tcl script (sys-start.tcl) that logs each time the fax server is started and what numerical
process ID (PID) is assigned to it:
# Filename: sys-start.tcl
# Description: script that is run startup of the fax scheduler.
#---------------------------------------------------
global argv argc env
#---------------------------------------------------
# Get all arguments and setup environment
set PID [lindex $argv 0 ]
set f [open $VSIFAX/spool/logs/sys-start.log a+]
#---------------------------------------------------
# Update log file
puts $f "The fax scheduler was started at: "
puts $f "The process ID is $PID"
exit 0
This is a sample start shell script (sys-start.sh) that logs each time the fax server is started and what numerical
process ID (PID) is assigned to it:
#!/bin/sh
#
# Filename: sys-start.sh
# Description: Script that is run at startup of the fax scheduler
# -----------------------------------------------------
# Get arguments
PID="$1"
LOG="$VSIFAX/spool/logs/sys-start.log"
# -----------------------------------------------------
# Update log file
echo "The fax scheduler was started at: `date`" > $LOG
echo "The process ID is $PID" > $LOG
# -----------------------------------------------------
#
exit 0
Below is a sample stop Tcl script (sys-stop.tcl) that sends an email message to anon@example.com every time
the fax server is stopped:
#
# Filename: sys-stop.tcl
# Description: script that is at shutdown of scheduler
#---------------------------------------------------
global argv argc env
#---------------------------------------------------
# Get all arguments and setup environment
set PID [lindex $argv 0 ]
set VSIFAX $env(VSIFAX)
set EMAIL "anon@example.com"
set SUBJECT "Warning from Esker"
set TMP_DIR "$VSIFAX/spool/temp"
set f [open $VSIFAX/spool/logs/sys-stop.log w]