heritrix is missing facility to shutdown from console

Description

Currently there's no option (according to `bin/heritrix --help`) to shutdown Heritrix from console. Such an option might be useful in an enviroment where you can't open a browser, e.g. because none is installed and there's no internet connection to install one.

Environment

None

Activity

Show:
Noah Levitt
February 5, 2016, 12:16 AM

The usual way to shut down heritrix is to kill the process...

Karl-Philipp Richter
February 5, 2016, 10:14 PM

This "usual" way appears quite unusual to me. If there's no intention of creating a command line option, I'd mention in `heritrix --help` that killing the process (with `SIGINT` I assume) is the recommended way to shut down.

Sending a signal or doing something more internal (e.g. invoking the routine which is invoked by the signal handler) could be wrapped in a command line option or a subcommand (e.g. `heritrix stop`).

Karl-Philipp Richter
February 5, 2016, 10:14 PM

This "usual" way appears quite unusual to me. If there's no intention of creating a command line option, I'd mention in `heritrix --help` that killing the process (with `SIGINT` I assume) is the recommended way to shut down.

Sending a signal or doing something more internal (e.g. invoking the routine which is invoked by the signal handler) could be wrapped in a command line option or a subcommand (e.g. `heritrix stop`).

Noah Levitt
February 8, 2016, 8:12 PM

heritrix --stop could work, if called from the same working directory where heritrix was started, since that's where heritrix.pid is written.

One hesitation is that heritrix --stop wouldn't know about any running crawls (without a bunch of extra work), so it's a bit dangerous. When you run kill, you know you're killing the process, but it might be unexpected for heritrix --stop to interrupt a running crawl without warning.

If you want to build a fancy heritrix --stop that checks for running crawls and does something smart about it, and it works well, I'd probably merge a pull request. It's just not a high priority for us to code right now.

Assignee

Unassigned

Reporter

Karl-Philipp Richter

Labels

None

Issue Category

None

Group Assignee

None

ZendeskID

None

Estimated Difficulty

None

Actual Difficulty

None

Affects versions

Priority

Major
Configure