From f869258635ec2bb1893aec128e78fe6777bfd26d Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 21 Feb 2023 09:07:29 +0800 Subject: [PATCH 1/2] Switch to modern service definition for elasticsearch-full --- Formula/elasticsearch-full.rb | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/Formula/elasticsearch-full.rb b/Formula/elasticsearch-full.rb index 52f9a4f..9654dcb 100644 --- a/Formula/elasticsearch-full.rb +++ b/Formula/elasticsearch-full.rb @@ -65,36 +65,11 @@ def caveats s end - plist_options :manual => "elasticsearch" - - def plist - <<~EOS - - - - - KeepAlive - - Label - #{plist_name} - ProgramArguments - - #{opt_bin}/elasticsearch - - EnvironmentVariables - - - RunAtLoad - - WorkingDirectory - #{var} - StandardErrorPath - #{var}/log/elasticsearch.log - StandardOutPath - #{var}/log/elasticsearch.log - - - EOS + service do + run [opt_bin/"elasticsearch", "--config", etc/"mongod.conf"] + working_dir var + log_path var/"log/elasticsearch.log" + error_log_path var/"log/elasticsearch.log" end test do From 0d0c0dfe122fd033bac8ec8bb0268daf949f3f0e Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 21 Feb 2023 09:10:27 +0800 Subject: [PATCH 2/2] Fix program arguments --- Formula/elasticsearch-full.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/elasticsearch-full.rb b/Formula/elasticsearch-full.rb index 9654dcb..bf55d32 100644 --- a/Formula/elasticsearch-full.rb +++ b/Formula/elasticsearch-full.rb @@ -66,7 +66,7 @@ def caveats end service do - run [opt_bin/"elasticsearch", "--config", etc/"mongod.conf"] + run [opt_bin/"elasticsearch"] working_dir var log_path var/"log/elasticsearch.log" error_log_path var/"log/elasticsearch.log"