Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew services minio typo #3564

Closed
naxmefy opened this issue Jan 11, 2017 · 11 comments
Closed

brew services minio typo #3564

naxmefy opened this issue Jan 11, 2017 · 11 comments

Comments

@naxmefy
Copy link

naxmefy commented Jan 11, 2017

Expected Behavior

$ brew services start minio

should execute minio server with defined arguments inside homebrew.mxcl.minio.plist

Current Behavior

it doesn't start the minio process

Possible Solution

inside minio.rb the line 58

currently:

<string>--address :9000</string>

should be

<string>--address=:9000</string>

Steps to Reproduce (for bugs)

  1. brew install minio
  2. brew services start minio
  3. console is printing
Jan 11 15:04:41 My-MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.minio[39214]): Service exited with abnormal code: 1
Jan 11 15:04:41 My-MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.minio): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
  1. log is:
Unknown flags. ‘--config-dir=etc/minio, --address :9000, var/minio’

Context

i could not run minio via brew service

Your Environment

  • Version used:
Version: 2016-12-13T17:19:42Z
Release-Tag: RELEASE.2016-12-13T17-19-42Z
Commit-ID: 29d72b84c07f9555f83a6485fe8291e18d23811b
  • Environment name and version (e.g. nginx 1.9.1): Shell? Brew? wtf?
  • Server type and version: server?
  • Operating System and version: OS X El Capitan 10.11.6
  • Link to your project: no project existing yet

Example homebrew.mxcl.minio.plist (base ond mongodb.plist)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>homebrew.mxcl.minio</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/opt/minio/bin/minio</string>
    <string>server</string>
    <string>--config-dir=/usr/local/etc/minio</string>
    <string>--address=:9000</string>
    <string>/usr/local/var/minio</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>
  <true/>
  <key>WorkingDirectory</key>
  <string>/usr/local</string>
  <key>StandardErrorPath</key>
  <string>/usr/local/var/log/minio/output.log</string>
  <key>StandardOutPath</key>
  <string>/usr/local/var/log/minio/output.log</string>
</dict>
</plist>

Example minio.rb for homebrew

class Minio < Formula
  desc "Amazon S3 compatible object storage server"
  homepage "https://github.com/minio/minio"
  url "https://github.com/minio/minio.git",
    :tag => "RELEASE.2016-12-13T17-19-42Z",
    :revision => "29d72b84c07f9555f83a6485fe8291e18d23811b"
  version "20161213171942"

  depends_on "go" => :build

  def install
    ENV["GOPATH"] = buildpath

    clipath = buildpath/"src/github.com/minio/minio"
    clipath.install Dir["*"]

    cd clipath do
      if build.head?
        system "go", "build", "-o", buildpath/"minio"
      else
        release = `git tag --points-at HEAD`.chomp
        version = release.gsub(/RELEASE\./, "").chomp.gsub(/T(\d+)\-(\d+)\-(\d+)Z/, 'T\1:\2:\3Z')
        commit = `git rev-parse HEAD`.chomp
        proj = "github.com/minio/minio"

        system "go", "build", "-o", buildpath/"minio", "-ldflags", <<-EOS.undent
            -X #{proj}/cmd.Version=#{version}
            -X #{proj}/cmd.ReleaseTag=#{release}
            -X #{proj}/cmd.CommitID=#{commit}
            EOS
      end
    end

    bin.install buildpath/"minio"

    (etc+"minio").mkpath
    (var+"minio").mkpath
    (var+"log/minio").mkpath
  end

  plist_options :manual => "minio server"

  def plist; <<-EOS.undent
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
   <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>#{plist_name}</string>
      <key>ProgramArguments</key>
      <array>
        <string>#{opt_bin}/minio</string>
        <string>server</string>
        <string>--config-dir=#{etc}/minio</string>
        <string>--address=:9000</string>
        <string>#{var}/minio</string>
      </array>
      <key>RunAtLoad</key>
      <true/>
      <key>KeepAlive</key>
      <true/>
      <key>WorkingDirectory</key>
      <string>#{HOMEBREW_PREFIX}</string>
      <key>StandardErrorPath</key>
      <string>#{var}/log/minio/output.log</string>
      <key>StandardOutPath</key>
      <string>#{var}/log/minio/output.log</string>
    </dict>
    </plist>
    EOS
  end

  test do
    system "#{bin}/minio", "version"
  end
end
@harshavardhana harshavardhana self-assigned this Jan 11, 2017
@harshavardhana
Copy link
Member

Thanks @naxmefy - we will fix it.

harshavardhana added a commit to harshavardhana/homebrew-core that referenced this issue Jan 11, 2017
Fixes an issue with 

```
brew services start minio
Jan 11 15:04:41 My-MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.minio[39214]): Service exited with abnormal code: 1
Jan 11 15:04:41 My-MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.minio): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
```

From log
```
Unknown flags. ‘--config-dir=etc/minio, --address :9000, var/minio’
```

Reference minio/minio#3564
@harshavardhana
Copy link
Member

Sent a PR upstream @naxmefy - Homebrew/homebrew-core#8743

@naxmefy
Copy link
Author

naxmefy commented Jan 11, 2017

i am not really familiar with homebrew formulars - that's the reason why i posted the solution here

@harshavardhana
Copy link
Member

i am not really familiar with homebrew formulars - that's the reason why i posted the solution here

No problem @naxmefy - it should have been done like this in first place. Thanks for that.

woodruffw pushed a commit to Homebrew/homebrew-core that referenced this issue Jan 14, 2017
Fixes an issue with

```
brew services start minio
Jan 11 15:04:41 My-MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.minio[39214]): Service exited with abnormal code: 1
Jan 11 15:04:41 My-MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.minio): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
```

From log
```
Unknown flags. ‘--config-dir=etc/minio, --address :9000, var/minio’
```

Reference minio/minio#3564

Closes #8743.

Signed-off-by: William Woodruff <william@tuffbizz.com>
@harshavardhana
Copy link
Member

Fixed upstream.

@joelanford
Copy link

Sorry to revive an old issue, but this seems to still be a problem in the latest version of the brew formula. I'm getting the following error message in the output.log file:

Incorrect Usage: flag provided but not defined: -address :9000

This line is still present in the plist file:

<string>--address :9000</string>

Adding an equal sign fixes the problem:

<string>--address=:9000</string>

@harshavardhana
Copy link
Member

harshavardhana commented Oct 5, 2017

@joelanford are you using brew install minio or brew install minio/stable/minio ? we recommend the latter.

@joelanford
Copy link

I was using brew install minio, but I uninstalled it and tried brew install minio/stable/minio as well. It seems to have the same problem.

I'm guessing these are the relevant files/lines?

Slightly off topic, but I also noticed that there may be permissions issues with the #{var}/log/minio directory. Does it need to be added to the post_install function?

  def post_install
    (var/"minio").mkpath
    (var/"log/minio").mkpath
    (etc/"minio").mkpath
  end

@harshavardhana
Copy link
Member

harshavardhana commented Oct 5, 2017

I was using brew install minio, but I uninstalled it and tried brew install minio/stable/minio as well. It seems to have the same problem.

I'm guessing these are the relevant files/lines?

minio: https://github.com/Homebrew/homebrew-core/blob/master/Formula/minio.rb#L66
minio/stable/minio: https://github.com/minio/homebrew-stable/blob/master/minio.rb#L44
Slightly off topic, but I also noticed that there may be permissions issues with the #{var}/log/minio directory. Does it need to be added to the post_install function?

def post_install
(var/"minio").mkpath
(var/"log/minio").mkpath
(etc/"minio").mkpath
end

That is a good suggestion, we are not native MacOS users so feel free to send a PR if you can :-)

@harshavardhana
Copy link
Member

Fixed by minio/homebrew-stable#8 - Thanks a lot for the fix @joelanford

@lock
Copy link

lock bot commented Apr 26, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants