#!/bin/sh
#
# Linux Job - inescapable job support
#
# description: Set the Host ID for generating a job ID (jid) and \
#	       load the job module if it is not built into the kernel.
### BEGIN INIT INFO
# Provides: job
# Required-Start: $local_fs $syslog $named
# Required-Stop: $local_fs $syslog
# Should-Start: cron
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: Starts Linux Job,
### END INIT INFO

jsethid=/usr/bin/jsethid

if [ ! -x $jsethid ] ; then
	echo "The job commands package is not properly installed."
	exit 1
fi

# See how we were called.
case "$1" in
  start)
	echo "Enabling Linux Jobs\n"
	$jsethid
	;;
  stop)
	echo -e "Disabling Linux Jobs\n"
	echo -e " No new jobs will be created. If Linux Jobs" \
		"support was loaded\n as a kernel module, you" \
		"can unload the module once the number of\n" \
		"running jobs is 0 (zero).  Use the lsmod" \
		"command to find if job\n module is loaded and" \
		"the rmmod command to unload it once the\n" \
		"used-count is 0. The jstat" \
		"command can be used\n to determine what jobs" \
		"are currently running."
	$jsethid 0xffffffff
	;;
  *)
	echo "Usage: $0 start|stop"
	exit 1
esac

exit 0
