firedown - file-based (remote) shutdown
firedown is a command line tool (written in Ruby)
that enables a remote shutdown of a Linux system
via Dropbox or other file synchronization services.
firedown monitors a specified directory (or several directories)
on the system for the presence of a trigger file or directory.
If a trigger is found,
firedown issues a shutdown.
The monitored directory might be synchronized via remote services like Dropbox, thus enabling a remotely triggered shutdown of the system.
Schedule a cron job on the machine(s) you might want to bring down remotely, specifying the directories that should be monitored (root privileges are needed).
For example, to check every minute for the trigger file, include a line similar to this in
* * * * * root firedown -l /path/to/monitored/directory
firedownas a daemon process (again with root privileges):
firedown --daemon /path/to/monitored/directory
(Depending on the search path for root on your machine and on how you installed
firedown, you might need to invoke
firedownusing its full path.)
Bring down the system by creating
firedown.host as empty trigger file
or as empty directory in any of the monitored directories,
host is the hostname of the system you want to bring down.
(With Dropbox this can be done over the web interface.)
As soon as a trigger file is detected in any of the monitored directories, a shutdown with a delay of 60 seconds will be issued. To prevent shutdowns from being triggered repeatedly by the same file, the system will only be brought down when the trigger previously has been removed successfully.
If run as a daemon,
firedown writes messages to
In non-daemon mode use the
-l option to write messages
to the log file instead of stderr.
You can set the logging level (
--logging-level debug (the default is
In daemon mode, you can toggle to
debug level and back
by sending the
SIGUSR1 signal to the
For testing, use the
-n option and the shutdown will
not be issued.
To prevent loss of data, only empty files and directories will trigger a shutdown.
Several machines sharing the same synchronized directory can be controlled individually, since each requires a different trigger file.
No code in the shared directory is executed.
No file needs to be edited.
You can either
clone or download the
firedownrepository and use
[sudo] rake installto install
firedownand its man page to
firedownmanually into the search path of root,
firedownanywhere and invoke it using its full path.
Ruby must be installed on your system.
No additional Ruby gems are needed to run
firedownhas been tested with Ruby 1.8.7 and Ruby 1.9.3 on a Linux machine.
firedown --help to display a brief help message.
If you installed
rake install you can read
its man page with
Report bugs on the
firedown home page: https://github.com/stomar/firedown/
Copyright © 2012-2017 Marcus Stollsteimer
firedown is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 or later (GPLv3+),
There is NO WARRANTY, to the extent permitted by law.