-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Add TeamPostgreSQL Cask #8279
Add TeamPostgreSQL Cask #8279
Conversation
|
||
zap :delete => [ | ||
'/Library/StartupItems/TeamPostgreSQL Service', | ||
'/private/var/folders/yf/bqb4c36s5pz43lczdbxncfgh0000gn/T/jetty-0.0.0.0-8082-webapp-_teampostgresql-any-', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be temporary and managed by the system. It shouldn’t be zapped.
Answer is “the best you can”. Here’s a similar case.
|
@vitorgalvao Is there a documented way of killing a process by doing something like If so, we can use that in the Reason being that there's no app bundle id, no Pinging @rolandwalker on this too, since it involves potentially undocumented or experimental DSL features. |
|
That won't work unfortunately, as the bundle id ( |
Hmm, actually the service can be stopped by running
Is it acceptable to add an
|
Just FYI, adding the [WIP] tag somehow gave me the option to cancel or confirm the merge, which should be a power limited to maintainers. Edit: Gone now. Weird. |
Installing this to test, I’ve noticed it has a Java dependency, so it’ll need a caveat to that effect. I’ll defer that part to @radeksimko, since he has been taking care of the java parts. |
The script in When uninstalling, should we assume that the user has not removed the script in |
Also, attempting to uninstall or zap the Cask when the service is not running results in an error message:
Can we easily intercept and ignore this message, or is there a better way to handle it? |
If that script changes its target depending on the chosen install location, then yes, we should use that one.
That message may or may not be problematic. It depends on if failure from |
HI!
But shutting down a launchctl job shouldn't be done from within The last I can recall, |
I'm not sure that this is a launchctl job. Nothing related to this Cask shows up when I run |
My bad! I didn't read closely enough. uninstall :script => {
:executable => '/Library/StartupItems/TeamPostgreSQL Service/TeamPostgreSQL Service',
:args => %w{stop}
},
:delete => [
'/Library/StartupItems/TeamPostgreSQL Service',
"#{Cask.appdir}/teampostgresql"
] I'm not sure it's correct that I have |
Yup, that's correct. There's still the issue of the uninstall failing if the daemon at Here's a dump of the terminal output:
|
Oh right. So you should add uninstall :script => {
:executable => '/Library/StartupItems/TeamPostgreSQL Service/TeamPostgreSQL Service',
:args => %w{stop},
:must_succeed => false
}, |
Excellent, that did the trick! Making the change and squashing now. I'm investigating a way to run this installer without launching the GUI. This looks promising, so I tried the following:
and everything goes fine until the installer tries to start the system service. Then it spits out this error
I've contacted the devs about this, and they said it could be a permissions issue. I doubt it, since the same thing happens when I try it after executing Ideally, we could bypass the GUI and not depend on the user to install the Cask somewhere expected. I'll keep looking into it. |
@rolandwalker Is there a blessed way of creating a wrapper script to be symlinked into The reason I ask is that this software is also available in a "cross-platform archive", which is just a The problem is that the launcher script depends on having the app's Java resources in the working directory, so we can't just symlink it with a But what we can do is just as simple: create a wrapper script that executes the launcher and symlink that into |
So far we have gotten along without creating any shim scripts, though it does come up from time to time. Currently there is only |
So there's no clean, documented way to do it, then. How about a dirty, undocumented way? |
@rolandwalker Alright, I've added a quick-and-dirty implementation. Will this fly, or is there a cleaner way of doing it? |
@jawshooah Could you squash your commits together? @rolandwalker @vitorgalvao Any feedback or this? |
@fanquake Done. I'd certainly welcome feedback, though. |
As said in this issue and in the jenkis one, we prefer to not create those types of scripts.
Which means that limitation isn’t due to our installation, but the app itself. There’s not much reason for us to create that workaround, then. Users should do it only if they want, just like they would if they installed it manually. |
@vitorgalvao But isn't reducing the frequency of such tedious manual installations one of the primary benefits of using The other problem is that, without that |
Yes, but the goal is to do it in a standard way. This means that a cask install shouldn’t have any surprises: it should mostly lead to the result you were expecting to achieve if doing it manually — a wrapper script is definitely not included in those. In principle most of the cases that require a wrapper script could be solved by a fix upstream, and incentivising those is something I see as a good thing1. In practice, however, these scripts could come in handy as a last resource, and as @rolandwalker mentioned, this does come up from time to time. Perhaps we should open a discussion for this in another issue. If we do end up deciding in favor of such capability, it should be both officially supported (no need for hacky solutions) and discouraged2. 1 It happens very often that submissions try to work around some peculiarity in open-source software via homebrew-cask instead of trying to resolve it upstream instead, where it could and should be solved most of the time. Programming sucks in part because we’re constantly building workarounds on top of workarounds, when sometimes the solution is to fix what’s broken. 2 |
I've gone ahead and submitted a pull request on Homebrew for this archive, as they're a little more lax in terms of style. I plan to come back to this soon and hopefully get the Mac installer working without having to go through the GUI. |
Like I said, I do see a divergence in this issue regarding the differences in principle and in practice, and perhaps we should open a discussion issue for this. Would you care to do it? I’d like to see opinions from other maintainers as well. It’s the second cask you envision working with a wrapper, and another one has cropped up a few hours ago, so we could use those as examples. The factor.rb cask is also an example in that similarly a shell script was suggested as a workaround but reaching out to the developers turned out to be the right solution, since it was a bug that has since been fixed. |
Remove temporary file Add uninstall_preflight, uninstall, caveats stanza Stop background service in uninstall_preflight. Delete core app files in uninstall stanza. Add caveat that user will have to manually run the uninstaller if Cask was installed to non-default location. Use uninstall :script instead of uninstall_preflight Allow uninstall when daemon is not running Use cross-platform archive instead of installer TeamPostgreSQL is available as a "cross-platform archive" in addition to a GUI-installed service. With this change, we use the archive instead of the installer, creating a wrapper script for the launcher and symlinking as a binary artifact.
Closing this as I no longer use this software, and there doesn't seem to be a demand. We can revisit if someone else needs it. |
This is a weird one. It uses a graphical installer, and a graphical uninstaller which is found in the install directory.
Since there's no support for graphical uninstallers yet, I'm not entirely sure what to use for the
uninstall
stanza.Also, the graphical uninstaller removes the install directory contents but not the directory itself, which is why I added
"#{Cask.appdir}/teampostgresql"
to thezap
stanza. This won't work if the user selects a different location in the graphical installer, but I figured it would cover most cases. Is there a better way to handle this?