To put a PID file such as /var/run/shogi-server/shogi-server.pid, if
directories do not exist, they will be created recursively.
A file named "STOP" in the base directory prevents the server from
starting new games including Floodgate matches.
(Closes #38544)
A file named "STOP" in the base directory prevents the server from
starting new games including Floodgate matches.
(Closes #38544)
+ * [shogi-server] Create a directory for a PID file.
+ To put a PID file such as /var/run/shogi-server/shogi-server.pid, if
+ directories do not exist, they will be created recursively.
+ (Closes #38546)
2018-04-07 Daigo Moriwaki <daigo at debian dot org>
2018-04-07 Daigo Moriwaki <daigo at debian dot org>
require 'shogi_server/config'
require 'shogi_server/util'
require 'shogi_server/league/floodgate_thread.rb'
require 'shogi_server/config'
require 'shogi_server/util'
require 'shogi_server/league/floodgate_thread.rb'
require 'tempfile'
#################################################
require 'tempfile'
#################################################
if $options["pid-file"]
$options["pid-file"] = File.expand_path($options["pid-file"], $topdir)
if $options["pid-file"]
$options["pid-file"] = File.expand_path($options["pid-file"], $topdir)
+ path = Pathname.new($options["pid-file"])
+ path.dirname().mkpath()
unless ShogiServer::is_writable_file? $options["pid-file"]
usage
$stderr.puts "Can not create the pid file: %s" % [$options["pid-file"]]
unless ShogiServer::is_writable_file? $options["pid-file"]
usage
$stderr.puts "Can not create the pid file: %s" % [$options["pid-file"]]