git: HAMMER: Add "hammer abort-cleanup" command
marino at crater.dragonflybsd.org
Wed May 20 01:21:53 PDT 2015
Author: John Marino <draco at marino.st>
Date: Sun Apr 5 13:06:49 2015 +0200
HAMMER: Add "hammer abort-cleanup" command
A new command has been added to HAMMER: abort-cleanup. As could be
deduced from its name, this command will terminate all active cleanup
operations. It takes no arguments.
It works by searching the /var/run directory for pidfiles starting with
"hammer.cleanup.". It gets the pid from the filename rather than by
reading the contents of the pidfile. Once the pid is obtained, the
SIGTERM signal is set to it. Any successfully terminated process will
be announced on stdout.
The SIGINT signal could also be used, but this one does not print
"Terminated" on the process's terminal, which I find useful.
Currently if the cleanup is interrupted another way, the pidfile will
not be removed. These hammer.cleanup pidfiles will accumulate until
the next "hammer abort-cleanup" command is executed. Stale pidfiles
will be removed if encountered by abort-cleanup command.
Summary of changes:
sbin/hammer/Makefile | 2 +-
sbin/hammer/cmd_abort.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++
sbin/hammer/cmd_cleanup.c | 16 +++++++-
sbin/hammer/hammer.8 | 7 +++-
sbin/hammer/hammer.c | 7 +++-
sbin/hammer/hammer.h | 3 +-
sbin/hammer/hammer_util.h | 7 ++++
7 files changed, 131 insertions(+), 8 deletions(-)
create mode 100644 sbin/hammer/cmd_abort.c
DragonFly BSD source repository
More information about the Commits