Revision 952c4515
Added by Sam Kottler over 11 years ago
- ID 952c4515f51069310b936fa5b2df25f0163fda11
lib/sinatra-patch.rb | ||
---|---|---|
FileUtils.mkdir_p(File.join(APP_ROOT, 'tmp/pids'))
|
||
|
||
# Create the PID's parent directory if it doesn't exist yet.
|
||
pid_path = SETTINGS.daemon_pid.gsub(/[^\/]+\/?$/, "")
|
||
FileUtils.mkdir_p(pid_path) unless File.exists?(pid_path)
|
||
if SETTINGS.daemon
|
||
pid_path = SETTINGS.daemon_pid.gsub(/[^\/]+\/?$/, "")
|
||
FileUtils.mkdir_p(pid_path) unless File.exists?(pid_path)
|
||
end
|
||
|
||
if SETTINGS.daemon and PLATFORM !~ /mingw/
|
||
Process.daemon(true)
|
Also available in: Unified diff
Fixes #2143: Only create the log file parent dir if daemonize is true