How can I stop the Pow server from starting up at computer boot (OS X)?

前端 未结 3 363
难免孤独
难免孤独 2021-01-06 09:29

TL;DR: Is there a way to disable the Pow server from starting when my machine boots up, but retain the ability to launch the server manually via powder up

相关标签:
3条回答
  • 2021-01-06 10:01

    Forgot to post the answer I ended up figuring out.

    Turns out this is pretty straightforward actually, and quite easy with the help of Lunchy (friendly wrapper for launchctl) and a quick bit o' bash aliasing. A little hacky and I don't know launchctl very well, but this does the trick.

    Steps (assumes Lunchy and Pow already installed):

    1. Run lunchy stop -w pow: this will stop Pow, and mark the service as disabled in launchctl, so Pow will not load when the machine starts. (This is same net effect of my initial attempts from the question.)
    2. Set up an alias in your .bash_profile (or .profile, etc) to force start the service. => alias pu='lunchy start -F pow'

    When you restart your machine, Pow should be stopped, and running pu (or your alias name) should start it up. You can see the list of services running before/after by running lunchy status.

    It's also a hacky but effective way to be able to start/stop groups of services you need for devlopment but don't necessarily want running the rest of the time (mongo, redis, etc).

    0 讨论(0)
  • 2021-01-06 10:06

    I came across this issue recently and solved it by simply moving cx.pow.powd.plist to another folder, which successfully disables auto start of the Pow server. When I want to start it again I just move cx.pow.powd.plist back into ~/Library/LaunchAgents/cx.pow.powd and run powder up.

    0 讨论(0)
  • 2021-01-06 10:11

    Use KeepAlive with PathState key.

    PathState <dictionary of booleans>
           Each key in this dictionary is a file-system path. If the value of the key is true, then the job
           will be kept alive as long as the path exists.  If false, the job will be kept alive in the
           inverse condition. The intent of this feature is that two or more jobs may create semaphores in
           the file-system namespace.
    

    Create a file at path when you want to launch pow server.

    0 讨论(0)
提交回复
热议问题