Daemonize daemonizes a Crystal process so that it properly runs in the background without needing an active terminal session. This is what many server processes do.
This is a shard of pending pull request https://github.com/crystal-lang/crystal/pull/2375.
Add this to your application's
dependencies: daemonize: github: DougEverly/daemonize.cr
See examples in the examples directory.
require "daemonize" Daemonize.daemonize
Daemonize also accepts file paths for STDIN, STDOUT, and STDERR. Defaults for all are "/dev/null".
require "daemonize" Daemonize.daemonize(stdout: "/dev/null", stderr: "/var/log/errors.log", stdin: "/var/tmp/a_file")
TODO: Write development instructions here
- Fork it ( https://github.com/DougEverly/daemonize.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- [DougEverly] Doug Everly - creator, maintainer