jdel / sspks

A very simple Synology Package Server, reverse engineered from the official Synology package repository and SynoCommunity.
GNU General Public License v3.0
257 stars 64 forks source link

install_dep_packages #43

Closed wouterteepe closed 7 years ago

wouterteepe commented 7 years ago

This may not be a bug, but maybe it is. Just checkin'

I have created this package with install_dep_packages in the INFO file. I am using DSM 6.0 and 6.1 (1 prod and 1 dev box) and have added the repo to the package center. When prior to installing, all preconditions are met, it installs fine. When prior to installing, NOT all preconditions are met, it gives an error. What I have seen with packages from Synology, is that it names out the dependencies and asks whether to install them.

Why I am raising this issue, is that I would like to check whether this is a metadata-in-sspks kind of issue. Any clues?

benrubson commented 7 years ago

Hi,

Depending on the _deppackages you want to install, you may want to use install_dep_services instead of install_dep_packages : https://developer.synology.com/developer-guide/synology_package/INFO_optional_fields.html

Does this help ?

wouterteepe commented 7 years ago

Hi Ben, Thanks for the pointer. Honestly, I can get confused from the difference between packages and services in DSM, when is comes to things like mysql which is a package that provides a service... What I did, I had a look at the MediaWiki plugin to see how a package which' installation behavior I want to copy, does it. In the MediaWiki INFO file, it says: install_dep_packages="WebStation>=2.0.0-0065:Apache2.2>=2.2.31-0005:MariaDB:PHP5.6>=5.6.17-0017" And, on a clean box, when selecting MediaWiki, it indeed asks whether I want to install all the others as well. In fact, it asks this before fully downloading the package, really immedeately.

Given that this is a package made by synology and it works (for them), install_dep_packages is what I need.

I copied this line verbatim into my own package's INFO file, and put the package in my sspks installation. When selecting my package, it tries to install it, but then at the end raises an error about missing packages, without mentioning them by name. When selecting my package, with all dependencies met, it nicely installs.

Of course, I can put in the documentation to install all the other stuff first, but that feels like something clunky that should be avoidable...

Thanks, Wouter

benrubson commented 7 years ago

Apache & MariaDB are provided through the install_dep_services keyword : https://developer.synology.com/developer-guide/synology_package/INFO.html https://developer.synology.com/developer-guide/synology_package/INFO_optional_fields.html

apache-sys = apache daemon listening on DSM ports (e.g. 5000 or 5001)
apache-web = apache daemon listening on Web Station ports (e.g. 80 or 443).
mdns = Multicast DNS Service Discovery
db = MySQL and PostgreSQL
apple network = Apple Network
nfs = NFS
ssh = SSH, Secure Shell
pgsql = PostgreSQL

So you should need : install_dep_services = apache-web db

wouterteepe commented 7 years ago

Thank you for thinking along and suggesting. I tried this, but had no success.

benrubson commented 7 years ago

Try adding qinst="false" in your INFO file ? (and of course your install_dep_packages line)

wouterteepe commented 7 years ago

Thank you for the pointer. It turns out qinst="false" does not work, but qinst="no" does the trick.

Now, it will politely tell me which package dependencies to install first (although it does not do it for me). Moreover, it will run the installer wizard that is embedded in the spk.

Thanks.

I did not find this qinst setting anywhere in the Synology documentation. Have I been blind, or is this some kind of a hidden feature?

benrubson commented 7 years ago

Perfect ! Once #38 will be solved, you will be able to remove qinst from your OPTION file. qinst is not documented and should not be used. We plan to correctly set it according to package configuration, refer to #38 for details about qinst 👍

wouterteepe commented 7 years ago

Thanks again. I read the other thread, I think the "new" observation of this thread is that the qinst issue not only influences the running of the wizard, but also whether package dependencies are treated nicely.

benrubson commented 7 years ago

Would be interesting to test a package without a wizard, but with dependencies, to see how it behaves with qinst enabled.

wouterteepe commented 7 years ago

Just tested that one for you. (you helped me out as well) spk with no wizard, qinst="no"

dependency not met: it politely suggests me to install the dependencies, and mentions them by name. dependency met: it installs fine.

benrubson commented 7 years ago

Thank you very much @wouterteepe 👍 And did you test without qinst="no" ? Because according to #38, we think about setting qinst="no" only if there is a wizard in the package. I think that your installation failed because your package has a wizard and was skipped by default qinst="yes".

wouterteepe commented 7 years ago

spk with no wizard, no qinst="no", but with dependencies

dependency not met: it tries to install but I get this error message:

p

dependency met: it works nicely.

benrubson commented 7 years ago

Thank you very much @wouterteepe for this test 👍 We have now to decide whether this "error message" is acceptable or not :) Perhaps we should also internally set qinst="no" when there are dependencies (services or packages). Thank you again 👍

wouterteepe commented 7 years ago

you're welcome :-) I would strongly vote for setting qinst="no" when there are dependencies. It will make sure the message that DSM gives me tells me how to resolve it.

benrubson commented 7 years ago

I thought your screenshot was cut but DSM gave you the list of packages to install... OK then :)

With qinst="no", with or without wizard, you have to install packages manually, right ?

I think that with install_dep_services, it will do it automatically. Perhaps you should try if you want something fully automated : install_dep_services = "apache-web db"

wouterteepe commented 7 years ago

to sum up: I believe to have tried all permutations of options. I have not been able to make DSM install all dependencies, or ask me whether to install all the dependencies.

without qinst="no", I would get the following message: p

with qinst="no", I will get the following message: q

I like the latter way way more over the first. (When more preconditions are not met, it will name them all.) (while testing, I have been installing and uninstalling mysql dozens of times as the single dependency that determines whether the preconditions are met.

benrubson commented 7 years ago

I also prefer the 2nd way yep 👍

But instead of install_dep_packages, did you try install_dep_services ? If you only need a database, then you would need : install_dep_services = "db" I'm pretty sure DSM will then do it automatically.

wouterteepe commented 7 years ago

In that case I have bad news for you. I have tried all 8 permutations of having install_dep_services, install_dep_packages, and qinst="no" and none of them caused an auto-install. That is on my test box, a ds213j with dsm 6.1 in almost virgin state.

and...I have my own package of node.js v6 which is one of the dependencies of the "real" package, which is not provided by synology but, eh, only by me. So for that package install_dep_services will never do :-\

benrubson commented 7 years ago

Mmmh yes bad news... :) For example when we try to install the WordPress Synology package, DSM notifies that dependencies will be automatically installed. I'll made some tests to try to reproduce this behaviour. Anyway, thank you again for all your tests 👍

wouterteepe commented 7 years ago

Today I thought all of a sudden: hey, the package that is being dependent upon, must be "silently installable" for the auto-install-dependencies feature to work. "Let's check that one tonight". It did not take until night to find out that in the depended-upon package, the INFO tags silent_install="yes" and silent_upgrade="yes" were already enabled. Bummer. So in case anyone revisits this thread with this idea: Sorry, it is already tested, and did not help.

benrubson commented 7 years ago

Was a good idea 👍 Perhaps it only works if all packages come from the same repository ? Do all your packages (base package + dependencies packages) come from your own repository ?

wouterteepe commented 7 years ago

In my case, one dependency package comes from Synology (MariaDB) and one comes from my own repository (Node.js v6). I feel a test coming up...

jdel commented 7 years ago

I need to get tcpdump going to see what goes through when installing the wordpress syno package.

I'll try to do that over the week end.