Table of Contents

foss-scheduler

The fossology scheduler daemon. This daemon runs the fossogy job input queue and agents.

The scheduler keeps track of three things: jobs, agents, and running tasks. If assigns each job to an agent, and ensures that there are not too many jobs running at the same time.

The logic works as follows:

For a detailed discussion of foss-scheduler see scheduler under Developer Docs on the fossology home page.

The scheduler must run as a member of group ‘fossy’. If it is started as root, then it will immediately change itself to run as user ‘fossy’ in group ‘fossy’.

SYNOPSIS

/usr/local/fossology/agents/foss-scheduler [options] [setup.conf] < 'type command'
Common usage:
/usr/local/fossology/agents/foss-scheduler -d -L /tmp/foss-scheduler.log

DESCRIPTION

This is the fossology job scheduler. When an upload is analyzed by fossology it is the scheduler that takes the upload and schedules a number of agents to operate on that upload. The most basic agents do things like unpack the archive and store it in the repository and the data-base. Other agents perform tasks like license analysis, and meta-data analysis.

The scheduler uses a configuration file to schedule the agents. This allows for flexible scheduling depending on the machines resources available. Usually the agent configuration file is created when fossology is installed. If setup.conf is not specified then /usr/local/share/fossology/agents/foss-scheduler.conf is used.

Advanced users or programmers adding agents to the system may need to regenerate this file or edit it directly. A custom file can also be used.

The setup.conf file defines each kind of known agent and how to run it. The list of jobs to run comes from the database’s jobqueue table. Alternately (for debugging), -I can be used to specify the jobs to run using stdin.

Configuring the Scheduler

The scheduler uses a configuration file to specify the number of processes per host and each agent. A configuration file creator script, mkconfig, is available to aid in the creation of this file. For example:

%Host localhost 2 1
agent=wget host=localhost | /usr/local/fossology/agents/wget_agent
agent=unpack host=localhost | /usr/local/fossology/agents/engine-shell unpack '/usr/local/fossology/agents/ununpack -d /home/repository//ununpack/%{U} -qRCQx'
agent=filter_license host=localhost | /usr/local/fossology/agents/Filter_License
agent=filter_license host=localhost | /usr/local/fossology/agents/Filter_License
agent=license host=localhost | /usr/local/fossology/agents/bsam-engine -L 20 -A 0 -B 60 -G 10 -M 2 -E -T license -O n -- - /usr/local/share/fossology/agents/License.bsam
agent=mimetype host=localhost | /usr/local/fossology/agents/mimetype
agent=mimetype host=localhost | /usr/local/fossology/agents/mimetype
agent=specagent host=localhost | /usr/local/fossology/agents/specagent
agent=filter_clean host=localhost | /usr/local/fossology/agents/filter_clean -s
agent=pkgmetagetta host=localhost | /usr/local/fossology/agents/pkgmetagetta
agent=pkgmetagetta host=localhost | /usr/local/fossology/agents/pkgmetagetta

The format of the configuration file is as follows:

Options

Examples

The standard way to stop foss-scheduler is usually done with sudo.

sudo /etc/init.d/fossology stop

Start the scheduler, checking the sched.conf file for problems. This is useful when changes have been made to the sched.conf file and one wants to verify that all agents will run with the new file.

sudo /usr/local/fossology/agents/foss-scheduler -t

Start the scheduler using a log and in verbose mode.

sudo /usr/local/fossology/agents/foss-scheduler -v -d -L /tmp/foss-scheduler.log

Author

Neal Krawetz