Overview

Wagenc is the encoding server for Wagtail.

Starting

Command: wagenc [switches]

You can run wagenc from the command line but normally you'd want to run wagenc from the start-up scripts on your server machine. On a rc type system use something like:

su - wagtail -c '/usr/local/bin/wagenc -unlock > /dev/null 2> /dev/null' &

This example presumes a used named 'wagtail'. I previously used sudo, but this only seemed to work when starting from rc. In other cases the binary directory would get mis-detected and so failed to find any of the library files. Your mileage may vary.

One day I'll put an init.d example here as well.

Locking

The job description files used by wagenc are created/read-from the desc directory. To avoid clashes a lockfile (.lock) is created in this directory when one of the processes is accessing it.

Although it shouldn't happen it is possible that this lock file persists when no processes are running. If this happens either delete the file by hand or start wagenc with the unlock switch.

Command-line switches

Name Description
-debug Turns on debug output.
-no-thrash number Will not start encoding if a new task has been added in the last number minutes. Setting this value helps to stop the hard-drive thrashing around is Wagenc receives new tasks whilst encoding old ones.
-port number Sets the port on which the server listens. Overrides the value in wagenc.conf.
-unlock Forcibly unlocks the job description directory. No error if the directory isn't locked so include as part of your startup scripts at will.

Stopping

To stop Wagenc simply kill (with TERM) the two wagenc processes. This is the best way to stop Wagenc even if running from a shell. Do not just Ctrl-C to stop Wagtail as if it is currently encoding, the signal will be caught by the encoding processes, not Wagenc. When the encoding processes exists with a non-zero return code Wagenc will consider the job failed and delete it from the queue.

Signal handling is something which needs to be worked on...