• R/O
  • HTTP
  • SSH
  • HTTPS

shogi-server: Commit

shogi-server source


Commit MetaInfo

Revisionf578431c0b279b436c5a537d6a61802d475690d7 (tree)
Time2018-08-26 09:14:48
AuthorDaigo Moriwaki <daigo@debi...>
CommiterDaigo Moriwaki

Log Message

[shogi-server] Create a directory for a PID file. (Closes #38546)

To put a PID file such as /var/run/shogi-server/shogi-server.pid, if
directories do not exist, they will be created recursively.

Change Summary

Incremental Difference

--- a/changelog
+++ b/changelog
@@ -4,6 +4,10 @@
44 A file named "STOP" in the base directory prevents the server from
55 starting new games including Floodgate matches.
66 (Closes #38544)
7+ * [shogi-server] Create a directory for a PID file.
8+ To put a PID file such as /var/run/shogi-server/shogi-server.pid, if
9+ directories do not exist, they will be created recursively.
10+ (Closes #38546)
711
812 2018-04-07 Daigo Moriwaki <daigo at debian dot org>
913
--- a/shogi-server
+++ b/shogi-server
@@ -34,6 +34,7 @@ require 'shogi_server'
3434 require 'shogi_server/config'
3535 require 'shogi_server/util'
3636 require 'shogi_server/league/floodgate_thread.rb'
37+require 'pathname'
3738 require 'tempfile'
3839
3940 #################################################
@@ -271,6 +272,8 @@ def check_command_line
271272
272273 if $options["pid-file"]
273274 $options["pid-file"] = File.expand_path($options["pid-file"], $topdir)
275+ path = Pathname.new($options["pid-file"])
276+ path.dirname().mkpath()
274277 unless ShogiServer::is_writable_file? $options["pid-file"]
275278 usage
276279 $stderr.puts "Can not create the pid file: %s" % [$options["pid-file"]]
Show on old repository browser