Git Product home page Git Product logo

Comments (16)

MikeMcQuaid avatar MikeMcQuaid commented on May 10, 2024

I'm also on 10.11.5 and am not able to reproduce this. The UserName stuff should be cleaned up at some point but it's not what's causing this error. What happens if you run httpd22 manually? Smells like it could be a local configuration issue.

from homebrew-services.

daFish avatar daFish commented on May 10, 2024

Running it manually works. This gets weirder and weirder.

from homebrew-services.

MikeMcQuaid avatar MikeMcQuaid commented on May 10, 2024

@daFish I'm afraid this doesn't look like a Homebrew issue. If you can figure out a fix and create a PR then we'll consider it. Sorry!

from homebrew-services.

daFish avatar daFish commented on May 10, 2024

Thanks, @MikeMcQuaid. I try to come up with a solution. However, I have the exact same issue on another machine running 10.11.5.

from homebrew-services.

MikeMcQuaid avatar MikeMcQuaid commented on May 10, 2024

@daFish Try to remove the UserName key and then brew reinstall.

from homebrew-services.

daFish avatar daFish commented on May 10, 2024

@MikeMcQuaid Still doesn't work. The UserName key is always readded when starting the service.

from homebrew-services.

daFish avatar daFish commented on May 10, 2024

Starting the service with sudo works as expected.

from homebrew-services.

MikeMcQuaid avatar MikeMcQuaid commented on May 10, 2024

@daFish You may also want to try and remove the relevant UserName code from brew services and see if that fixes it.

from homebrew-services.

MikeMcQuaid avatar MikeMcQuaid commented on May 10, 2024

also CC @ilovezfs for thoughts.

from homebrew-services.

ilovezfs avatar ilovezfs commented on May 10, 2024

Perhaps they got stricter and made the incorrect usage an error instead of just ignoring it.

As a workaround, @daFish can you try opening brew-services.rb, and changing

    # Force fix UserName
    if !ServicesCli.root?
      if data =~ %r{<key>UserName</key>}
        # Replace existing UserName value with current user
        data = data.gsub(%r{(<key>UserName</key>\s*<string>)[^<]*(</string>)}, '\1' + ServicesCli.user + '\2')
      else
        # Add UserName key and value to end of plist if it doesn't already exist
        data = data.gsub(%r{(\s*</dict>\s*</plist>)}, "\n    <key>UserName</key>\n    <string>" + ServicesCli.user + "</string>\\1")
      end
    elsif data =~ %r{<key>UserName</key>}
      # Always remove UserName key entirely if running as root
      data = data.gsub(%r{(<key>UserName</key>\s*<string>)[^<]*(</string>)}, "")
    end

to

    if data =~ %r{<key>UserName</key>}
      data = data.gsub(%r{(<key>UserName</key>\s*<string>)[^<]*(</string>)}, "")
    end

from homebrew-services.

daFish avatar daFish commented on May 10, 2024

@ilovezfs This worked and I was able to start the services without any problems.

from homebrew-services.

ilovezfs avatar ilovezfs commented on May 10, 2024

Cool. You may want to commit that change for now, since brew update will try to stash it otherwise.

cd /usr/local/Library/Taps/homebrew/homebrew-services
git add cmd/brew-services.rb
git commit -m "username go away please"

from homebrew-services.

MikeMcQuaid avatar MikeMcQuaid commented on May 10, 2024

@ilovezfs Thanks! Would you or @daFish mind making a PR for that?

from homebrew-services.

ilovezfs avatar ilovezfs commented on May 10, 2024

@MikeMcQuaid Sure. Let's go with that as a workaround, clean up the formulae, and then drop the section entirely.

from homebrew-services.

MikeMcQuaid avatar MikeMcQuaid commented on May 10, 2024

@ilovezfs Sounds good.

from homebrew-services.

daFish avatar daFish commented on May 10, 2024

@MikeMcQuaid Done.

from homebrew-services.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.