CS 422 - Operating Systems
Batch Queue Program
Write a batch processing queue manager and a queue submission program.
The queue manager will need to be kept running most the time and should
monitor the queue for command files to be processed. When a file appears,
begin executing it by forking a child process running the bash shell to
process the commands in the command file and then remove the entry from
the queue.
Use shared memory to hold the batch queue. Make sure you test for
queue full upon submission and handle problems appropriately.
Include a cancel command that can be used by any user
to remove any entry from the queue. If the entry is
currently being executed, terminate the execution.
During execution, output should be redirected and logged into a log file.
Write a program that will print the list of files in the
queue. Include an entry number to make it easier to specify
which entry to cancel.
Summary of Requirements
- A Batch Queue Spooler program that monitors the batch queue for command
files to be executed. When a file appears (because it has been added) in the
queue, the spooler should run the bash program to execute it.
Most of the time the spooler should
sleep and wake up periodically to check the queue for files to be executed.
Only one command file should be executed at a time.
- A Submit command (program) that will submit a file name (and directory
path) into the batch queue for execution. A nice improvement is for the
submit program to issue a wakeup signal to the spooler program so that
program can sleep for longer periods of time knowing that it will be woken
up if a file is submitted for execution.
- A List Batch Queue command that will print the list of files in the batch
queue being printed and waiting to be printed. The list should give any information
that will be necessary in specifying which entry is to be deleted or canceled.
- A Delete command that will delete an entry from the queue so that it
does not get executed. If the entry is in the process of executing, it should
be terminated.