#!/bin/bash # $HeadURL$ $LastChangedRevision$ # Note this error message is sent to the terminal as it is imperative the user understands the failure. [ $(id -u) = 0 ] || { echo "${0##*/}: this test can only pass when run as root" >/dev/tty; exit 1; } echo "setting up environment ..." export JS_NAME=$(tr -dc A-Za-z0-9 &1 | sed -r -e 's/(child processes) \([1-9][0-9, ]*\) (are still running)/\1 () \2/' & #jsd --suspend -r slots:1 & JSD_PID=$! sleep 5 # settle time echo "submitting a job that spawns children ..." # make jss verbose because we're interested to see that the job ID it # mentions is the same as the one that js-shepherd complains has left # child processes running. jss -v -r slots:1 "bash -c 'sleep 1234 &'" echo "resuming jsd and waiting for jobs to complete ..." jsc resume wait_for_jobs echo "cleaning up ..." jsc quit wait $JSD_PID echo "all done"