Newsgroups: comp.sources.misc From: alan@tharr (Alan Saunders) Subject: v25i020: QBATCH - a queued batch processing system for UNIX, Part01/06 Message-ID: X-Md4-Signature: dbf4aafb132a8f7a0a9dea0bed6653c1 Date: Tue, 5 Nov 1991 03:44:39 GMT Approved: kent@sparky.imd.sterling.com Submitted-by: alan@tharr (Alan Saunders) Posting-number: Volume 25, Issue 20 Archive-name: QBATCH/part01 Environment: UNIX QBATCH is a versatile, configurable queued batch processing system for *NIX. Using it, instead of batch or simply '&' the batch workload on a system can be tuned to provide optimum throughput. For more detailed informa- tion see the DESCRIPTION file, and the docs. QBATCH was posted earlier in the year to alt.sources. In response to mail from people trying to port it, I have completely revamped it in terms of it's configurability, and rewritten the documentation. Enjoy... Alan ------------ #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'MANIFEST' <<'END_OF_FILE' X File Name Archive # Description X----------------------------------------------------------- X DESCRIPTION 3 Outline description (sales blurb) X INSTALL 3 Installation notes and bewares X MANIFEST 1 This shipping list X NEWS 4 Update history X NOTICE 2 Copyright/disclaimer YOU MUST READ THIS! X README 1 Guess what? X doc 1 X doc/Index 1 Index to documentation X doc/chap.01 2 X doc/chap.02 3 X doc/chap.03 2 X doc/chap.04 5 X doc/chap.05 4 X doc/chap.06 4 X doc/chap.07 3 X doc/chap.08 3 X doc/chap.09 3 X doc/glossary 2 Limited glossary of terms used X magic 1 X man 1 X man/jj.l 1 [nt]roff source man pages X man/jk.l 1 X man/jm.l 1 X man/jn.l 1 X man/jobdone.l 1 X man/jr.l 1 X man/js.l 2 X man/lman 1 script to make a readable doc from man page X man/qa.l 1 X man/qbatch.l 3 X man/qc.l 4 X man/qd.l 1 X man/qe.l 1 X man/qf.l 2 X man/qg.l 1 X man/qh.l 1 X man/ql.l 1 X man/qp.l 1 X man/qs.l 1 X man/qt.l 2 X man/queue.l 2 X man/qw.l 1 X man/qxenv.l 1 X man/rc.QBATCH.l 1 X src 1 Sources and Makefile for QBATCH X src/Makefile 3 X src/config.c 4 X src/config.h 4 X src/jdgen 1 X src/jj.c 4 X src/jk.c 5 X src/jm.c 2 X src/jn.c 2 X src/jr.c 1 X src/js.c 5 X src/patchlevel.h 1 X src/qagen 1 X src/qbatch.h 2 X src/qc.c 3 X src/qd.c 1 X src/qe.c 1 X src/qf.c 5 X src/qg.c 1 X src/qh.c 1 X src/ql.c 3 X src/qp.c 6 X src/qs.c 2 X src/qt.c 2 X src/qw.c 1 X src/rcgen 1 X src/time.c 2 X src/what.h 1 X src/whatgen 1 END_OF_FILE if test 2656 -ne `wc -c <'MANIFEST'`; then echo shar: \"'MANIFEST'\" unpacked with wrong size! fi # end of 'MANIFEST' fi if test -f 'README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README'\" else echo shar: Extracting \"'README'\" \(3100 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' X QBATCH .. a queued batch processing system for UNIX X X The QBATCH system and its related programs were X written by Alan D. Saunders and are X Copyright (c) Vita Services Ltd. 1990 and X Copyright (c) Vita Fibres Ltd. 1991 X X PLEASE read the NOTICE file for details. X QBATCH was written to overcome the limitations of the UNIX at and batch commands where there is a need for potentially several job queues containing jobs to be processed in a specific order. On some versions of UNIX, it is possible to gain this effect by utilising the print spooling system. QBATCH provides a portable, consistent method of achieving this object on all flavours of UNIX (I hope). X XFor details of what QBATCH is, and the related programs, please read the DESCRIPTION file and the documents in the doc directory. Corresponding man pages are available in the man directory. The X'qbatch' document (and man page) gives an overview of QBATCH, and a brief description of the programs and files involved. Each is described in more detail in a separate document (and man page). X XFor details of the terms and conditions for the use and distribution of QBATCH please read the NOTICE file which accompanies this distribution. NOTE: You are bound to read and accept the contents of this NOTICE file as a condition of the right to distribute, port and use QBATCH. X My only access to the net is through tharr PUBLIC access to Unix and it is through their courtesy and generosity that QBATCH may be distributed to you. X QBATCH is my first posting to the net at large, and as it was originally written for my own purposes, it may be found to be a little X'raw', If so I apologise and ask you to bear with me and (gently) correct me in my ways. -- Alan X QBATCH was originally written on a SUN SPARCstation under SunOS 4.03, and has migrated through SunOS 4.1. It is now running in live systems under SunOS 4.1 and 4.1.1 on SPARCstation and SPARCserver 4/330's. It was written as far as possible using X-OPEN (tm) guidelines according to XPG3, and using SunOS's system V programming environment. I don't therefore expect too many major problems porting it to other environments. X I wrote QBATCH to suit my own requirements under SunOS, and having no access to other environments or architectures, have made no provision in configuration files, sources or makefiles, for porting to other environments or architectures. X X30 Aug 1991 .. Latest version has a degree of configuration for X different platforms. see NEWS for details. X Please therefore feel free to make such configuration modifications as you feel necessary to get it to work in your environment, but please also make sure I get a copy of all changes so that I can include them in the distribution for the benefit of others. X The programs may be installed in any directory accessible through the PATH environment variable. They will be installed by the Makefile in the defined BINDIR. X X XEnjoy ... Alan Saunders (July 23 1991) X (Aug 30 1991) I may be contacted at home (Snail mail) X X1341 Rochdale Road, Blackley, Manchester, M9 2FG, United Kingdom. X or alan@tharr.uucp END_OF_FILE if test 3100 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test ! -d 'doc' ; then echo shar: Creating directory \"'doc'\" mkdir 'doc' fi if test -f 'doc/Index' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/Index'\" else echo shar: Extracting \"'doc/Index'\" \(843 characters\) sed "s/^X//" >'doc/Index' <<'END_OF_FILE' X X QBATCH a queued batch processing system for UNIX X X X The QBATCH system and its related programs were X written by Alan D. Saunders and are X Copyright (c) Vita Services Ltd. 1990 and X Copyright (c) Vita Fibres Ltd. 1991 X CHAPTER INDEX: X chap.01 INTRODUCTION Description of queued batch processing, and QBATCH. X chap.02 DESCRIPTION Outline description of how QBATCH works. X chap.03 ADMINISTRATION Commands available only to the super user. X chap.04 USER Commands anyone can use. X chap.05 MONITORS What they are, and how to configure and use them. X chap.06 CONFIGURATION What needs to be done to install a working QBATCH. X chap.07 TUNING How to get the best out of QBATCH. X chap.08 FIXED Fixed context, What it means, and how to use it. X chap.09 SECURITY Notes and comments about system security and QBATCH. END_OF_FILE if test 843 -ne `wc -c <'doc/Index'`; then echo shar: \"'doc/Index'\" unpacked with wrong size! fi # end of 'doc/Index' fi if test -f 'magic' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'magic'\" else echo shar: Extracting \"'magic'\" \(37 characters\) sed "s/^X//" >'magic' <<'END_OF_FILE' X0 string qBq QBATCH queue file END_OF_FILE if test 37 -ne `wc -c <'magic'`; then echo shar: \"'magic'\" unpacked with wrong size! fi # end of 'magic' fi if test ! -d 'man' ; then echo shar: Creating directory \"'man'\" mkdir 'man' fi if test -f 'man/jj.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/jj.l'\" else echo shar: Extracting \"'man/jj.l'\" \(2017 characters\) sed "s/^X//" >'man/jj.l' <<'END_OF_FILE' X.TH JJ 1L "14 May 1991" JJ "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B jj X\- Job jump. move an entry towards the front of the queue. X.SH SYNOPSIS X.B jj X[ X.BI \-e " entryno" X] X.B qname X|[ X.BI \-v X] X.SH DESCRIPTION The queue is searched for an the specified entry. If the user owns that entry (i.e the uid of the user attempting to jump a job is either the same as that of the user who originally submitted it, or is that of the super user), the job may be moved. If the previous job in the queue is also owned by this user, the positions of the two jobs in the queue will be swapped. This is repeated until the previous job in the queue is NOT owned by this user. If the queue is active and a job is currently being processed, the job being moved cannot jump above the active job. otherwise, in an idle queue, and subject to ownership restrictions, a job may be moved to the top of the queue. X.br The super user may jump any job to the top of an idle queue, or to second in an active queue. X.br An ordinary user may only jump a job to the front of a consecutive group of his or her own jobs. (i.e. may not jump a job above one owned by another user.) X.br In a fixed context queue, where the uid of a submitted job has been changed, the original submitting user may not be able to jump the job(s) they submitted. This is because the ownership of the job has also changed. X.SH OPTIONS X.TP 12 X.BI \-e " entryno" MANDATORY. Specify the entry number in the queue of the job to be moved. X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 2017 -ne `wc -c <'man/jj.l'`; then echo shar: \"'man/jj.l'\" unpacked with wrong size! fi # end of 'man/jj.l' fi if test -f 'man/jk.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/jk.l'\" else echo shar: Extracting \"'man/jk.l'\" \(1690 characters\) sed "s/^X//" >'man/jk.l' <<'END_OF_FILE' X.TH JK 1L "14 May 1991" JK "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B jk X\- Job kill. remove a job from this queue (optionally kill it). X.SH SYNOPSIS X.B jk X[ X.B \-k X] X[ X.B \-a X] X[ X.BI \-u " userid" X] X[ X.BI \-e " entryno" X] X.B qname X|[ X.BI \-v X] X.SH DESCRIPTION The identified entries are removed from the queue X(if they are owned by the user, or the user is the super user) and the associated temporary jcl files are deleted. X.br if the -k option is specified, and a job to be removed is being processed, the queue header is updated with the kill flag set, and a signal is sent to the queue process engine. X.SH OPTIONS X.TP 12 X.B \-k Kill the job being removed if it is currently being processed. X.TP X.B \-a All. remove all jobs owned by the user. The super user may remove all jobs in the queue. X.TP X.BI \-u " userid" If the superuser uses the -a option, it's effect can be limited to those jobs owned by X. jk will fail if an ordinary user uses this option, and does not match his or her own uid. X.TP X.BI \-e " entry number" XEither the -a option or this option are MANDATORY If not all jobs, then this identifies the entry to be removed. X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1690 -ne `wc -c <'man/jk.l'`; then echo shar: \"'man/jk.l'\" unpacked with wrong size! fi # end of 'man/jk.l' fi if test -f 'man/jm.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/jm.l'\" else echo shar: Extracting \"'man/jm.l'\" \(1511 characters\) sed "s/^X//" >'man/jm.l' <<'END_OF_FILE' X.TH JM 1L "14 May 1991" JM "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B jm X\- job monitor. Add or alter monitor for a given job. X.SH SYNOPSIS X.B jm X[ X.BI \-e " entryno" X] X.B "qname monitor" X|[ X.BI \-v X] X.SH DESCRIPTION The queue entry for the specified job is updated with the new monitor pathspec. X.br If the entry number is not specified, the first job in the queue is assumed. X.br If the entry to be modified is actually being processed, the following action takes place: If the queue is the same as the QUEUE environment variable, and the specified monitor is NOT the same as that already stored in the queue entry, then after updating the entry with the new monitor, the queue header is updated with the kill and repeat flags set and a signal is sent to the process engine. This will abandon, and restart the job with a new monitor. X.SH OPTIONS X.TP 12 X.BI \-e " entryno" specify the entry number in the queue of the job to be altered. Default is the first job in the queue. X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1511 -ne `wc -c <'man/jm.l'`; then echo shar: \"'man/jm.l'\" unpacked with wrong size! fi # end of 'man/jm.l' fi if test -f 'man/jn.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/jn.l'\" else echo shar: Extracting \"'man/jn.l'\" \(1050 characters\) sed "s/^X//" >'man/jn.l' <<'END_OF_FILE' X.TH JN 1L "14 May 1991" JN "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B jn X\- job name. Add or alter name for a given job X.SH SYNOPSIS X.B jn X[ X.BI \-e " entryno" X] X.B "qname namestring" X|[ X.BI \-v X] X.SH DESCRIPTION The queue entry for the specified job is updated with the new descriptive name for the job. If entryno is not specified, the first job in the queue will be assumed. X.SH OPTIONS X.TP 12 X.BI \-e " entryno" specify the entry number in the queue of the job to be altered. Default is the first job in the queue. X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1050 -ne `wc -c <'man/jn.l'`; then echo shar: \"'man/jn.l'\" unpacked with wrong size! fi # end of 'man/jn.l' fi if test -f 'man/jobdone.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/jobdone.l'\" else echo shar: Extracting \"'man/jobdone.l'\" \(1387 characters\) sed "s/^X//" >'man/jobdone.l' <<'END_OF_FILE' X.TH JOBDONE 5L "14 May 1991" JOBDONE "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B jobdone X\- The interface script between the queue process engine and the submitting user. X.SH SYNOPSIS X.B jobdone X.B qname X.B entryno X.B action X.B username X.B tty X.SH DESCRIPTION X.B jobdone is a bourne shell script called by the queue process engine when a job has terminated. The parameters passed are as described above. In it's distributed version it simply either sends mail to the submitting user, or writes a message on their tty, depending on the value of action. X.SH OPTIONS X.TP 12 X.B qname The name of the queue in which the job ran. X.TP X.B entryno The actual entry number in the queue. X.TP X.B action The action to be taken: X.nf X 1. Write a message on tty. X 2. Mail submitting user. X Anything else .. no action. X.fi X.TP X.B username The logged in name of the submitting user. X.TP X.B tty The terminal from which the job was submitted. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qt (1L) X.BR qs (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1387 -ne `wc -c <'man/jobdone.l'`; then echo shar: \"'man/jobdone.l'\" unpacked with wrong size! fi # end of 'man/jobdone.l' fi if test -f 'man/jr.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/jr.l'\" else echo shar: Extracting \"'man/jr.l'\" \(1223 characters\) sed "s/^X//" >'man/jr.l' <<'END_OF_FILE' X.TH JR 5L "11 May 1991" JR "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B jr X\- job repeat. repeat (optionally kill) current job. X.SH SYNOPSIS X.B jr X[ X.B \-k X] X.B qname X|[ X.BI \-v X] X.SH DESCRIPTION The queue header is updated with the repeat and optionally the kill flag set, and a signal is sent to the process engine. When the job has terminated (or been killed), the entry will not be removed from the queue, but will remain to be reprocessed. X.SH OPTIONS X.TP 12 X.B \-k Kill the job being processed. If the queue is active, abandons current process and starts again from the beginning of the jcl. If the queue has been stopped, the entry will remain in the queue until it is processed again. X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1223 -ne `wc -c <'man/jr.l'`; then echo shar: \"'man/jr.l'\" unpacked with wrong size! fi # end of 'man/jr.l' fi if test -f 'man/lman' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/lman'\" else echo shar: Extracting \"'man/lman'\" \(128 characters\) sed "s/^X//" >'man/lman' <<'END_OF_FILE' if [ -f $1 ] then for i in $* do echo $i nroff -man -Tman $i >../doc/`basename $i .l` done else echo "Usage: lman " fi END_OF_FILE if test 128 -ne `wc -c <'man/lman'`; then echo shar: \"'man/lman'\" unpacked with wrong size! fi chmod +x 'man/lman' # end of 'man/lman' fi if test -f 'man/qa.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qa.l'\" else echo shar: Extracting \"'man/qa.l'\" \(1922 characters\) sed "s/^X//" >'man/qa.l' <<'END_OF_FILE' X.TH QE 1L "14 May 1991" QE "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B qa X\- Queue availability. List queues the user is permitted to submit to. X.SH SYNOPSIS X.B qa X.SH DESCRIPTION This script echoes headings, then calls qt -l for each file in QUEUEPATH. The result is a list of brief queue status information of all queues that the user is permitted to submit jobs to. X.RS -6 viz: X.nf Queues available to alan X Queue No. Priority Fixed Enabled Halted Stopped Name Entries (nice) Context X fasq 2 -5 no yes no no fault 0 0 no yes no no fcon 14 10 yes yes no yes fcsq 4 5 no yes no no fcst 1 -5 no yes no no intq 0 0 no no no no invq 1 0 no yes no no mant 2 -5 no yes no no masq 2 -5 no yes no no mbsq 0 10 no no no no slwq 8 15 no yes no no sopq 4 5 no yes no no sopt 3 -5 no yes no no work 11 8 no yes no no X.RE X.fi X.SH OPTIONS X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qc (8L) X.BR qd (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1922 -ne `wc -c <'man/qa.l'`; then echo shar: \"'man/qa.l'\" unpacked with wrong size! fi # end of 'man/qa.l' fi if test -f 'man/qd.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qd.l'\" else echo shar: Extracting \"'man/qd.l'\" \(873 characters\) sed "s/^X//" >'man/qd.l' <<'END_OF_FILE' X.TH QD 1L "14 May 1991" QD "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B qd X\- Queue disable. Prevent jobs being submitted to this queue. X.SH SYNOPSIS X.B qd X.BI qname X|[ X.BI \-v X] X.SH DESCRIPTION The queue header will be updated with the enabled flag unset such that further attempts to submit a job to this queue will be rejected. X.SH OPTIONS X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 873 -ne `wc -c <'man/qd.l'`; then echo shar: \"'man/qd.l'\" unpacked with wrong size! fi # end of 'man/qd.l' fi if test -f 'man/qe.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qe.l'\" else echo shar: Extracting \"'man/qe.l'\" \(874 characters\) sed "s/^X//" >'man/qe.l' <<'END_OF_FILE' X.TH QE 1L "14 May 1991" QE "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B qe X\- Queue enable. Enable jobs to be submitted to this queue. X.SH SYNOPSIS X.B qe X.BI qname X|[ X.BI \-v X] X.SH DESCRIPTION The queue header will be updated with the enabled flag reset such that further attempts to submit a job to this queue will be permitted. X.SH OPTIONS X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 874 -ne `wc -c <'man/qe.l'`; then echo shar: \"'man/qe.l'\" unpacked with wrong size! fi # end of 'man/qe.l' fi if test -f 'man/qg.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qg.l'\" else echo shar: Extracting \"'man/qg.l'\" \(973 characters\) sed "s/^X//" >'man/qg.l' <<'END_OF_FILE' X.TH QG 1L "14 May 1991" QG "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B qg X\- Queue go. resume processing of currently suspended job in this queue. X.SH SYNOPSIS X.B qg X.BI qname X|[ X.BI \-v X] X.SH DESCRIPTION The queue header will be updated with the halt flag unset, and a signal will be sent to the process activity. X.br The process activity will send a SIGCONT signal to the process group of the job to resume the job's processing. X.SH OPTIONS X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 973 -ne `wc -c <'man/qg.l'`; then echo shar: \"'man/qg.l'\" unpacked with wrong size! fi # end of 'man/qg.l' fi if test -f 'man/qh.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qh.l'\" else echo shar: Extracting \"'man/qh.l'\" \(990 characters\) sed "s/^X//" >'man/qh.l' <<'END_OF_FILE' X.TH QH 1L "14 May 1991" QH "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B qh X\- Queue halt. suspend processing of current job in this queue. X.SH SYNOPSIS X.BI qh " qname" X|[ X.BI \-v X] X.SH DESCRIPTION The queue header will be updated with the halt flag set and a signal will be sent to the process activity. X.br The process activity will send a SIGSTOP signal to the process group of the job to suspend the job's (and all it's children's) processing. X.SH OPTIONS X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 990 -ne `wc -c <'man/qh.l'`; then echo shar: \"'man/qh.l'\" unpacked with wrong size! fi # end of 'man/qh.l' fi if test -f 'man/ql.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/ql.l'\" else echo shar: Extracting \"'man/ql.l'\" \(2521 characters\) sed "s/^X//" >'man/ql.l' <<'END_OF_FILE' X.TH QL 1L "14 May 1991" QL "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B ql X\- queue list. list the contents and status of a queue. X.SH SYNOPSIS X.B ql X[ X.B \-a X] X.B qname X|[ X.BI \-v X] X.SH DESCRIPTION A formatted report on the status of the named queue is produced on stdout as follows: X.br A. An idle queue: X.nf X.sp Status of : work Spooling in : /var/spool/batch/ Monitor is : /var/spool/batch/work.mon Priority is : 0 Queue last started : 2/10/91 15:02:37 Queue is idle X X No of Active Queue Job Job Queue Queue X Entries (pid) Accepting Repeated Killed Halted Stopped X 2 No Yes No No No Yes X X 1 alan ttyp1 23/04/90 16:34:36 Cobol compilation X 2 fred ttyh4 23/04/90 17:04:36 Statements run X.sp B. An active queue: X.sp Status of : work Spooling in : /var/spool/batch/ Monitor is : /var/spool/batch/work.mon Priority is : 0 Queue last started : 2/10/91 15:02:37 Current job started : 23/04/90 17:08:50 X X No of Active Queue Job Job Queue Queue X Entries (pid) Accepting Repeated Killed Halted Stopped X 2 1698 Yes No No No No X X 1 1703 alan ttyp1 23/04/90 16:34:36 Cobol compilation X 2 fred ttyh4 23/04/90 17:04:36 Statements run X.fi X.sp Information from the queue header is displayed, including the default files and directories. All relevant queue flags are displayed. Each job in the queue is displayed on a separate line following the header information. X.br In an active queue, the pid of the queue process activity is displayed with the header details, and the pid of the currently running job is displayed in the first entry record. X.SH OPTIONS X.TP 12 X.B \-a All. Print the uid, gid, jcl filename and monitor filename for each job in the queue as well as the basic information. X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 2521 -ne `wc -c <'man/ql.l'`; then echo shar: \"'man/ql.l'\" unpacked with wrong size! fi # end of 'man/ql.l' fi if test -f 'man/qp.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qp.l'\" else echo shar: Extracting \"'man/qp.l'\" \(1758 characters\) sed "s/^X//" >'man/qp.l' <<'END_OF_FILE' X.TH QP 1L "11 May 1991" QP "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B qp X\- queue process. start a process engine for a given queue X.SH SYNOPSIS X.B qp X.B qname X|[ X.BI \-v X] X.SH DESCRIPTION X.B qp will start a background process which monitors the named queue, and when the queue contains jobs to be processed, will fork a child activity to do so. The child will set uid and gid to match those of the submittor, or in the case of a fixed context queue, that specified, set up the environment, and execute the job. X.B qp will then wait for the child to finish processing before checking the queue for more jobs. X.B qp also handles signal communication with the (single at any time) running job in the named queue, X(halt, go, and kill). If there are no jobs waiting in the queue, X.B qp will wait for a signal from one of the queue or job management programs. X.B qp also sets the stdout and stderr for the child job to a file (usually defaulted when the queue is created) qp will checkpoint this file at the start and end of each job, and write profile timings of the form queued (time on queue before processing started, real (wall clock), user and system cpu times. The time formats are of the form HH:MM:SS.ss. X.SH OPTIONS X.TP 12 X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1758 -ne `wc -c <'man/qp.l'`; then echo shar: \"'man/qp.l'\" unpacked with wrong size! fi # end of 'man/qp.l' fi if test -f 'man/qs.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qs.l'\" else echo shar: Extracting \"'man/qs.l'\" \(1835 characters\) sed "s/^X//" >'man/qs.l' <<'END_OF_FILE' X.TH QS 5L "11 May 1991" QS "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B qs X\- Queue stop. Terminate the queue process engine for the named queue. X.SH SYNOPSIS X.B qs X[[ X.B \-k X] X| X[ X.B \-r X]] X[ X.B \-w X] X.B qname X|[ X.BI \-v X] X.SH DESCRIPTION The queue header is updated with the stop flag (and optionally the kill and repeat flags) set. When the current job terminates X(which will be immediately if the kill flag is set), the process engine will update the queue header to remove it's process id, If the -w option is specified, the program will sleep for 30 seconds, then check the queue header. It will repeat this cycle until the process engine pid is found to be zero, (that is the job has finished, and the engine has terminated) and then terminate. If the -w option is not specified, the program will terminate immediately upon updating the queue header. X.SH OPTIONS X.TP 12 X.B \-k Kill. Kill the currently running job so that the queue process terminates immediately. X.TP X.B \-r Repeat and kill. Update the repeat flag in the queue header, and kill the job. The process engine will terminate immediately, but the job will not be removed from the queue and will be available to be rerun when the process engine is restarted. X.TP X.B \-w Wait until current job has completed before exiting. X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1835 -ne `wc -c <'man/qs.l'`; then echo shar: \"'man/qs.l'\" unpacked with wrong size! fi # end of 'man/qs.l' fi if test -f 'man/qw.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qw.l'\" else echo shar: Extracting \"'man/qw.l'\" \(1057 characters\) sed "s/^X//" >'man/qw.l' <<'END_OF_FILE' X.TH QW 1L "14 May 1991" QW "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B qw X\- Queue wait. Wait until the queue process engine has terminated. X.SH SYNOPSIS X.B qw X.BI qname X|[ X.BI \-v X] X.SH DESCRIPTION The queue header will be read and if the queue is idle (the queue process engine pid is zero) the program will terminate immediately. If the queue is not idle, the program will sleep for 30 seconds, and check the header again. This will be repeated until the queue becomes idle, when the program will terminate. X.SH OPTIONS X.TP X.BI \-v Display QBATCH version and copyright information. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1057 -ne `wc -c <'man/qw.l'`; then echo shar: \"'man/qw.l'\" unpacked with wrong size! fi # end of 'man/qw.l' fi if test -f 'man/qxenv.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/qxenv.l'\" else echo shar: Extracting \"'man/qxenv.l'\" \(1083 characters\) sed "s/^X//" >'man/qxenv.l' <<'END_OF_FILE' X.TH QXENV 5L "11 May 1991" QXENV "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B \.qxenv X\- Description of a qbatch .qxenv file. X.SH DESCRIPTION X .qxenv is a file used by the X.B QBATCH system to store information on a system - wide basis relating to environment variables which are not to be copied to the environment of running jobs. Certain environment variables (such as TERM and TERMCAP) have no meaning in a batch context, others may unknowingly alter the processing of a batch job. X .qxenv is a simple text file, readable (only) by root, containing a list X(one per line) of the environment variables to be excluded. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR rc.QBATCH (8L) X.BR jobdone (8L) X.BR queue (5L) END_OF_FILE if test 1083 -ne `wc -c <'man/qxenv.l'`; then echo shar: \"'man/qxenv.l'\" unpacked with wrong size! fi # end of 'man/qxenv.l' fi if test -f 'man/rc.QBATCH.l' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/rc.QBATCH.l'\" else echo shar: Extracting \"'man/rc.QBATCH.l'\" \(1549 characters\) sed "s/^X//" >'man/rc.QBATCH.l' <<'END_OF_FILE' X.TH rc.QBATCH 8L "14 May 1991" rc.QBATCH "QUEUED BATCH PROCESSING SYSTEM" X.SH COPYRIGHT The X.B QBATCH system and its related programs are Copyright: X.br X(c) Vita Services Ltd. 1990 X.br X(c) Vita Fibres Ltd. 1991 X.SH NAME X.B rc.QBATCH X\- QBATCH system startup script. X.SH SYNOPSIS X.B "/etc/rc.QBATCH" X>/dev/console X.SH DESCRIPTION rc.QBATCH should be called from the system startup script. This may vary between systems, but is usually in /etc, and usually starts with rc. There may in fact be several files or directories relating to system startup. X.br X.B rc.QBATCH examines the qbatch directory (QUEUEPATH or a directory linked to it), and for each of the files found, checks that it is a valid X.B QBATCH queue. If it is, it then checks the pid stored in the queue header. If this pid is non - zero, it is assumed that the queue was being processed when the system was shut down. In this case X.B rc.QBATCH will start a new process engine. X.br if X.B rc.QBATCH restarts a queue, it will further check whether a job was being processed when the machine shut down. If so, X.B rc.QBATCH will sleep for 20 seconds after starting the queue process engine to ensure that the job has processed to a 'settled' state. X.SH OPTIONS None. X.SH FILES X.ft B QUEUEPATH/* X.SH "SEE ALSO" X.BR qbatch (1L) X.BR jj (1L) X.BR jk (1L) X.BR jm (1L) X.BR jn (1L) X.BR jr (1L) X.BR js (1L) X.BR qa (1L) X.BR qc (8L) X.BR qd (1L) X.BR qe (1L) X.BR qf (1L) X.BR qg (1L) X.BR qh (1L) X.BR ql (1L) X.BR qp (1L) X.BR qs (1L) X.BR qt (1L) X.BR qw (1L) X.BR jobdone (8L) X.BR queue (5L) X.BR qxenv (5L) END_OF_FILE if test 1549 -ne `wc -c <'man/rc.QBATCH.l'`; then echo shar: \"'man/rc.QBATCH.l'\" unpacked with wrong size! fi # end of 'man/rc.QBATCH.l' fi if test ! -d 'src' ; then echo shar: Creating directory \"'src'\" mkdir 'src' fi if test -f 'src/jdgen' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/jdgen'\" else echo shar: Extracting \"'src/jdgen'\" \(325 characters\) sed "s/^X//" >'src/jdgen' <<'END_OF_FILE' cat >jobdone <'src/jr.c' <<'END_OF_FILE' X/************************************************************************/ X/* */ X/* jr .. job repeat. repeat (optionally to kill) current job) */ X/* */ X/* usage: jr [-k] qname */ X/* */ X/* Copyright (c) Vita Services 1990 */ X/* (c) Vita Fibres 1990 1991 */ X/* */ X/************************************************************************/ X X#include "qbatch.h" int fpq = 0; int kflag = 0, rflag = 0; uid_t uid; char *queuename; char queue[128]; char buff [128]; X#include "config.h" X X main (argc, argv, envp) int argc; char *argv[], *envp[]; X{ X int c; X extern char *optarg; X extern int optind; X while ((c = getopt (argc, argv, "kv")) != -1) X switch (c) X { X case 'k': kflag = 1; X break; X case 'v': q_version(); X case '?': qb_term (-1); X } X if (optind >= argc) X { X fprintf (stderr, "Usage: jr [-k] qname\n"); X exit (-1); X } X queuename = argv[optind]; X strcpy (queue, QUEUEPATH); X strcat (queue, queuename); X qb_setterm(); X fpq = open (queue, O_RDWR); X if (fpq == -1) X { X fprintf (stderr, "Invalid queue name: %s\n", queuename); X qb_term (-1); X } X q_lock(fpq); X read (fpq, &head, sizeof(head)); X if (bad_queue()) qb_exit(-1); X read (fpq, &entry, sizeof(entry)); X uid = geteuid(); X if (uid != 0 && uid != entry.qe_uid) X { X fprintf (stderr, "Must own the job or be super user to repeat or kill\n"); X qb_term (-1); X } X if ((head.qh_flags&qh_repeat) == 0) X { X head.qh_flags += qh_repeat; X } X if (kflag) X { X if ((head.qh_flags&qh_kill) == 0) X { X head.qh_flags += qh_kill; X } X } X lseek (fpq, 0, SEEK_SET); X write (fpq, &head, sizeof(head)); X q_unlock(fpq); X close(fpq); fpq = 0; X tell_qp(); X qb_term(0); X} END_OF_FILE if test 2269 -ne `wc -c <'src/jr.c'`; then echo shar: \"'src/jr.c'\" unpacked with wrong size! fi # end of 'src/jr.c' fi if test -f 'src/patchlevel.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/patchlevel.h'\" else echo shar: Extracting \"'src/patchlevel.h'\" \(21 characters\) sed "s/^X//" >'src/patchlevel.h' <<'END_OF_FILE' X#define PATCHLEVEL 0 END_OF_FILE if test 21 -ne `wc -c <'src/patchlevel.h'`; then echo shar: \"'src/patchlevel.h'\" unpacked with wrong size! fi # end of 'src/patchlevel.h' fi if test -f 'src/qagen' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/qagen'\" else echo shar: Extracting \"'src/qagen'\" \(275 characters\) sed "s/^X//" >'src/qagen' <<'END_OF_FILE' cat >qa <'src/qd.c' <<'END_OF_FILE' X/************************************************************************/ X/* */ X/* qd .. Queue disable. Prevent jobs being submitted to this queue. */ X/* */ X/* usage: qd qname */ X/* */ X/* Copyright (c) Vita Services 1990 */ X/* (c) Vita Fibres 1990 1991 */ X/* */ X/************************************************************************/ X X#include "qbatch.h" int fpq = 0; int pid; char *queuename; char queue[128]; char buff [128]; X#include "config.h" X main (argc, argv, envp) int argc; char *argv[], *envp[]; X{ X if (getuid() != 0) X { X fprintf (stderr, "Must be root to disable a queue\n"); X exit (-1); X } X if (argc == 1) X { X puts ("Usage qd queuename"); X qb_term (0); X } X if (strcmp(argv[1], "-v") == 0) q_version(); X queuename = argv[1]; X strcpy (queue, QUEUEPATH); X strcat (queue, queuename); X qb_setterm(); X fpq = open (queue, O_RDWR); X if (fpq == -1) X { X fprintf (stderr, "Invalid queue name: %s\n", queuename); X qb_term (-1); X } X pid = getuid(); X if (pid != 0) X { X fprintf (stderr, "Must be super user to disable a queue\n"); X qb_term (-1); X } X q_lock(fpq); X read (fpq, &head, sizeof(head)); X if (bad_queue()) qb_exit(-1); X if ((head.qh_flags&qh_enabled) != 0) X { X head.qh_flags -= qh_enabled; X } X else X { X fprintf (stderr, "Queue %s is already disabled\n", queuename); X qb_term (-1); X } X lseek (fpq, 0, SEEK_SET); X write (fpq, &head, sizeof(head)); X qb_term(0); X} END_OF_FILE if test 1975 -ne `wc -c <'src/qd.c'`; then echo shar: \"'src/qd.c'\" unpacked with wrong size! fi # end of 'src/qd.c' fi if test -f 'src/qe.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/qe.c'\" else echo shar: Extracting \"'src/qe.c'\" \(2020 characters\) sed "s/^X//" >'src/qe.c' <<'END_OF_FILE' X/************************************************************************/ X/* */ X/* qe .. Queue enable. Enable jobs to be submitted to this queue. */ X/* */ X/* usage: qe qname */ X/* */ X/* Copyright (c) Vita Services 1990 */ X/* (c) Vita Fibres 1990 1991 */ X/* */ X/************************************************************************/ X X#include "qbatch.h" int fpq = 0; uid_t uid; char *queuename; char queue[128]; char buff [128]; X#include "config.h" X X main (argc, argv, envp) int argc; char *argv[], *envp[]; X{ X if (getuid() != 0) X { X fprintf (stderr, "Must be root to enable a queue\n"); X exit (-1); X } X if (argc == 1) X { X puts ("Usage qe queuename"); X qb_term (0); X } X if (strcmp(argv[1], "-v") == 0) q_version(); X queuename = argv[1]; X strcpy (queue, QUEUEPATH); X strcat (queue, queuename); X qb_setterm(); X fpq = open (queue, O_RDWR); X if (fpq == -1) X { X fprintf (stderr, "Invalid queue name: %s\n", queuename); X qb_term (-1); X } X uid = getuid(); X if (uid != 0) X { X fprintf (stderr, "Must be super user to disable a queue\n"); X qb_term (-1); X } X q_lock(fpq); X read (fpq, &head, sizeof(head)); X if (bad_queue()) qb_exit(-1); X if ((head.qh_flags&qh_enabled) == 0) X { X head.qh_flags += qh_enabled; X } X else X { X fprintf (stderr, "Queue %s is already enabled\n", queuename); X qb_term (-1); X } X lseek (fpq, 0, SEEK_SET); X write (fpq, &head, sizeof(head)); X q_unlock(fpq); X close(fpq); fpq = 0; X qb_term(0); X} END_OF_FILE if test 2020 -ne `wc -c <'src/qe.c'`; then echo shar: \"'src/qe.c'\" unpacked with wrong size! fi # end of 'src/qe.c' fi if test -f 'src/qg.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/qg.c'\" else echo shar: Extracting \"'src/qg.c'\" \(1918 characters\) sed "s/^X//" >'src/qg.c' <<'END_OF_FILE' X/************************************************************************/ X/* */ X/* qg .. Queue go. resume processing of current job in this queue. */ X/* */ X/* usage: qg qname */ X/* */ X/* Copyright (c) Vita Services 1990 */ X/* (c) Vita Fibres 1990 1991 */ X/* */ X/************************************************************************/ X X#include "qbatch.h" int fpq = 0; uid_t uid; char *queuename; char queue[128]; char buff[128]; X#include "config.h" X X main (argc, argv, envp) int argc; char *argv[], X *envp[]; X{ X if (argc == 1) X { X puts ("Usage qg queuename"); X qb_term (0); X } X if (strcmp(argv[1], "-v") == 0) q_version(); X queuename = argv[1]; X strcpy (queue, QUEUEPATH); X strcat (queue, queuename); X qb_setterm(); X fpq = open (queue, O_RDWR); X if (fpq == -1) X { X fprintf (stderr, "Invalid queue name: %s\n", queuename); X qb_term (-1); X } X uid = getuid (); X if (uid != 0) X { X fprintf (stderr, "Must be super user to resume a queue\n"); X qb_term (-1); X } X q_lock(fpq); X read (fpq, &head, sizeof (head)); X if (bad_queue()) qb_exit(-1); X if (head.qh_pid == 0) X { X fprintf (stderr, "Queue %s is idle\n", queuename); X qb_term (-1); X } X if ((head.qh_flags & qh_halt) != 0) X { X head.qh_flags -= qh_halt; X } X else X { X fprintf (stderr, "Queue %s is not halted\n", queuename); X qb_term (-1); X } X lseek (fpq, 0, SEEK_SET); X write (fpq, &head, sizeof(head)); X q_unlock(fpq); X close (fpq); X fpq = 0; X tell_qp(); X exit (0); X} END_OF_FILE if test 1918 -ne `wc -c <'src/qg.c'`; then echo shar: \"'src/qg.c'\" unpacked with wrong size! fi # end of 'src/qg.c' fi if test -f 'src/qh.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/qh.c'\" else echo shar: Extracting \"'src/qh.c'\" \(1920 characters\) sed "s/^X//" >'src/qh.c' <<'END_OF_FILE' X/************************************************************************/ X/* */ X/* qh .. Queue halt. suspend processing of current job in this queue. */ X/* */ X/* usage: qh qname */ X/* */ X/* Copyright (c) Vita Services 1990 */ X/* (c) Vita Fibres 1990 1991 */ X/* */ X/************************************************************************/ X X#include "qbatch.h" int fpq = 0; uid_t uid; char *queuename; char queue[128]; char buff[128]; X#include "config.h" X X main (argc, argv, envp) int argc; char *argv[], X *envp[]; X{ X if (argc == 1) X { X puts ("Usage qh queuename"); X qb_term (0); X } X if (strcmp(argv[1], "-v") == 0) q_version(); X queuename = argv[1]; X strcpy (queue, QUEUEPATH); X strcat (queue, queuename); X qb_setterm(); X fpq = open (queue, O_RDWR); X if (fpq == -1) X { X fprintf (stderr, "Invalid queue name: %s\n", queuename); X qb_term (-1); X } X uid = getuid (); X if (uid != 0) X { X fprintf (stderr, "Must be super user to halt a queue\n"); X qb_term (-1); X } X q_lock(fpq); X read (fpq, &head, sizeof (head)); X if (bad_queue()) qb_exit(-1); X if (head.qh_pid == 0) X { X fprintf (stderr, "Queue %s is idle\n", queuename); X qb_term (-1); X } X if ((head.qh_flags & qh_halt) == 0) X { X head.qh_flags += qh_halt; X } X else X { X fprintf (stderr, "Queue %s is already halted\n", queuename); X qb_term (-1); X } X lseek (fpq, 0, SEEK_SET); X write (fpq, &head, sizeof(head)); X q_unlock(fpq); X close (fpq); X fpq = 0; X tell_qp(); X exit (0); X} END_OF_FILE if test 1920 -ne `wc -c <'src/qh.c'`; then echo shar: \"'src/qh.c'\" unpacked with wrong size! fi # end of 'src/qh.c' fi if test -f 'src/qw.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/qw.c'\" else echo shar: Extracting \"'src/qw.c'\" \(1521 characters\) sed "s/^X//" >'src/qw.c' <<'END_OF_FILE' X/************************************************************************/ X/* */ X/* qw .. queue wait. wait till queue is idle. */ X/* */ X/* usage: qw qname */ X/* */ X/* Copyright (c) Vita Services 1990 */ X/* (c) Vita Fibres 1990 1991 */ X/* */ X/************************************************************************/ X X#include "qbatch.h" int fpq = 0; int kflag = 0, rflag = 0; char *queuename; char queue[128]; char buff [128]; X#include "config.h" X main (argc, argv, envp) int argc; char *argv[], *envp[]; X{ X X if (argc != 2) X { X fprintf(stderr, "Usage : qw \n"); X exit (-1); X } X if (strcmp (argv[1], "-v") == 0) q_version(); X queuename = argv[1]; X strcpy (queue, QUEUEPATH); X strcat (queue, queuename); X qb_setterm(); X do X { X fpq = open (queue, O_RDWR); X q_lock(fpq); X read (fpq, &head, sizeof(head)); X if (bad_queue()) qb_exit(-1); X q_unlock(fpq); X close (fpq);fpq = 0; X if (head.qh_pid == 0) break; X sleep (30); X } X while (head.qh_pid != 0); X X qb_term (0); X} END_OF_FILE if test 1521 -ne `wc -c <'src/qw.c'`; then echo shar: \"'src/qw.c'\" unpacked with wrong size! fi # end of 'src/qw.c' fi if test -f 'src/rcgen' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/rcgen'\" else echo shar: Extracting \"'src/rcgen'\" \(731 characters\) sed "s/^X//" >'src/rcgen' <<'END_OF_FILE' ech=A`echo -n ""` if [ ${ech:-\c} = "A-n" ] then X n="" X c=\\c else X n=-n X c="" fi cat >rc.QBATCH <'src/what.h' <<'END_OF_FILE' static char QbSID[]= "@(#) QBATCH (c) Version: 2.0 (31 October 1991)"; END_OF_FILE if test 72 -ne `wc -c <'src/what.h'`; then echo shar: \"'src/what.h'\" unpacked with wrong size! fi # end of 'src/what.h' fi if test -f 'src/whatgen' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/whatgen'\" else echo shar: Extracting \"'src/whatgen'\" \(732 characters\) sed "s/^X//" >'src/whatgen' <<'END_OF_FILE' X#!/bin/sh X#************************************************************************# X#* *# X#* whatgen Create what.h containing the correct patchlevel. *# X#* *# X#* Copyright (c) Vita Services 1990 *# X#* (c) Vita Fibres 1990 1991 *# X#* *# X#************************************************************************# set `cat patchlevel.h` echo "static char QbSID[]= \042@(#) QBATCH (c) \tVersion: 2.$3 \ X(31 October 1991)\042;">what.h END_OF_FILE if test 732 -ne `wc -c <'src/whatgen'`; then echo shar: \"'src/whatgen'\" unpacked with wrong size! fi chmod +x 'src/whatgen' # end of 'src/whatgen' fi echo shar: End of archive 1 \(of 6\). cp /dev/null ark1isdone MISSING="" for I in 1 2 3 4 5 6 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 6 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 exit 0 # Just in case... -- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM Sterling Software, IMD UUCP: uunet!sparky!kent Phone: (402) 291-8300 FAX: (402) 291-4362 Please send comp.sources.misc-related mail to kent@uunet.uu.net.