YUKI Hiroshi
null+****@clear*****
Thu Sep 18 14:17:50 JST 2014
YUKI Hiroshi 2014-09-18 14:17:50 +0900 (Thu, 18 Sep 2014) New Revision: 9568461313d85d929f5eb785c21399d3584254c2 https://github.com/droonga/droonga-engine/commit/9568461313d85d929f5eb785c21399d3584254c2 Message: Clear old data correctly even if droonga-engine is running as a service Modified files: bin/droonga-engine-configure Modified: bin/droonga-engine-configure (+10 -3) =================================================================== --- bin/droonga-engine-configure 2014-09-18 14:04:52 +0900 (f4d604d) +++ bin/droonga-engine-configure 2014-09-18 14:17:50 +0900 (7792094) @@ -49,13 +49,17 @@ def installed_as_service? return true if succeeded result = `SYSTEMCTL_SKIP_REDIRECT=yes service droonga-engine status` - result.include?("droonga-engine is stopped") + result.include?("running") or result.include?("droonga-engine is stopped") end def service_user_name "droonga-engine" end +def service_base_directory + "/home/#{service_user_name}/droonga" +end + def running?(configuration) if installed_as_service? result = `SYSTEMCTL_SKIP_REDIRECT=yes service droonga-engine status` @@ -137,14 +141,17 @@ if !options[:quiet] and options[:reset].nil? "\"droonga-engine.yaml\" to be regenerated?") end + +Droonga::Path.base = service_base_directory if installed_as_service? + if running unjoin(configuration) stop_service(configuration) end if options[:clear] - FileUtils.rm_rf(Droonga::Path.databases) - FileUtils.rm_rf(Droonga::Path.state) + FileUtils.rm_rf(Droonga::Path.databases.to_s) + FileUtils.rm_rf(Droonga::Path.state.to_s) end if options[:reset] -------------- next part -------------- HTML����������������������������... Download