Skip to content

zabbix-server: add version 7#18345

Merged
AndWac merged 1 commit into
OpenIndiana:oi/hipsterfrom
cgrzemba:zabbix-7
Aug 13, 2024
Merged

zabbix-server: add version 7#18345
AndWac merged 1 commit into
OpenIndiana:oi/hipsterfrom
cgrzemba:zabbix-7

Conversation

@cgrzemba

@cgrzemba cgrzemba commented Aug 1, 2024

Copy link
Copy Markdown
Contributor

This PR provides the Zabbix server,proxy and agent component in version 7. It provides the support for Postgresql only.

There is an issue with the Postresql library dependency. If I let the buildsystem do all automatically it adds all Postresql versions to the REQUIRED_PACKAGES.

If I add
<transform file path=usr/sbin/zabbix_server -> add pkg.depend.bypass-generate (.)lib(.)/libpq.so.*>
then 'gmake REQUIRED_PACKAGES' removes the Postgresql library dependency at all.

What is the correct way here?

@cgrzemba

cgrzemba commented Aug 1, 2024

Copy link
Copy Markdown
Contributor Author

It is also the Postgres timescaldb extension necessary.

@mtelka

mtelka commented Aug 1, 2024

Copy link
Copy Markdown
Contributor

I assume the build uses the generic (mediated) library at /usr/lib/amd64/libpq.so.5 and so it adds all PostgreSQL versions that could possibly satisfy that (so basically all) to REQUIRED_PACKAGES. This is obviously not what we want.

You should make sure that one specific PostgreSQL version is used using macros from the make-rules/shared-macros.mk file (like PG_LIBDIR). Or maybe pg_config (PG_CONFIG) could be used for that. But since zabbix seems to do not use pg_config (otherwise everything would just work) at all, then you probably need the macros fallback anyway.

@cgrzemba

cgrzemba commented Aug 2, 2024

Copy link
Copy Markdown
Contributor Author

Your are right. The problem is this library path list
-L/usr/openssl/3.1/lib/64 -L/usr/lib/amd64 -L/usr/postgres/16/lib/amd64 -L/usr/lib/amd64/openldap -L/usr/lib/amd64
/usr/lib/amd64 has to be on the tail of the list.

@cgrzemba cgrzemba force-pushed the zabbix-7 branch 4 times, most recently from 904ab73 to b2f530f Compare August 2, 2024 12:16
@cgrzemba cgrzemba marked this pull request as ready for review August 7, 2024 18:14
@AndWac

AndWac commented Aug 8, 2024

Copy link
Copy Markdown
Contributor

I have run gmake sample-manifest here:
configure: error: PostgreSQL library not found
gmake: *** [/export/home/andreas/oi-userland/make-rules/configure.mk:173: /export/home/andreas/oi-userland/components/network/zabbix/build/amd64/.configured] Error 1

You'll need to manually add the build dependency on
database/postgres-16/developer

@cgrzemba cgrzemba force-pushed the zabbix-7 branch 2 times, most recently from f332680 to c9f2bb6 Compare August 13, 2024 19:22
@AndWac AndWac merged commit b766b3f into OpenIndiana:oi/hipster Aug 13, 2024
@mtelka

mtelka commented Aug 14, 2024

Copy link
Copy Markdown
Contributor

This change added the application/management/zabbix-agent package, but the same package is already provided by the network/zabbix-agent component. This is obviously wrong because we cannot deliver single package from two components.

@cgrzemba, could you please fix this issue?

Thank you.

PS: The issue was detected by oi-pkg-checker.

@AndWac

AndWac commented Aug 15, 2024 via email

Copy link
Copy Markdown
Contributor

@mtelka

mtelka commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

Have you considered to create a package for oi-pkg-checker?

Yes. This is my long term plan, once the project is a bit more polished.

@AndWac

AndWac commented Aug 15, 2024 via email

Copy link
Copy Markdown
Contributor

@mtelka

mtelka commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

I think we should split this single zabbix folder into at least two (and maybe three) separate folders because zabbix-server has a lot more dependencies (eg. postgressql) than zabbix-agent.

The component's build dependencies and the runtime package dependencies are very loosely related. The amount of build dependencies is not a problem in a case when the actual packages are designed properly. This seems to be the case here, maybe with one exception:

I noticed that zabbix_get got moved from the zabbix-agent@6.2.7 package to the zabbix-proxy@7.0.1 package. I'm not sure where it really belongs (I know nothing about Zabbix), but from the zabbix_get(1) man page I'd say it should stay in zabbix-agent.

Anyway, back to the main topic:

Since both network/zabbix and network/zabbix-agent components are compiled from the same source tarball - zabbix-$(COMPONENT_VERSION).tar.gz - the proper solution in this case seems to be simple git rm -r components/network/zabbix-agent.

Also some minor tweaks in the components/network/zabbix directory are needed, so it does not say the zabbix-agent is the server (please note Summary):

$ pkg info pkg://openindiana.org/application/management/zabbix-agent@7.0.1-2024.0.0.0:20240813T203127Z
             Name: application/management/zabbix-agent
          Summary: Zabbix server
         Category: Applications/System Utilities
            State: Installed
        Publisher: openindiana.org
          Version: 7.0.1
           Branch: 2024.0.0.0
   Packaging Date: August 13, 2024 at 08:31:27 PM
Last Install Time: February 20, 2024 at 01:15:28 AM
 Last Update Time: August 13, 2024 at 11:54:47 PM
             Size: 1.33 MB
             FMRI: pkg://openindiana.org/application/management/zabbix-agent@7.0.1-2024.0.0.0:20240813T203127Z
      Project URL: http://www.zabbix.com/
       Source URL: https://cdn.zabbix.com/zabbix/sources/stable/7.0/zabbix-7.0.1.tar.gz
$

vs.

$ pkg info -r pkg://openindiana.org/application/management/zabbix-agent@6.2.7-2023.0.0.0:20230227T190250Z
          Name: application/management/zabbix-agent
       Summary: Zabbix agent
      Category: Applications/System Utilities
         State: Not installed
     Publisher: openindiana.org
       Version: 6.2.7
        Branch: 2023.0.0.0
Packaging Date: February 27, 2023 at 07:02:50 PM
          Size: 1.25 MB
          FMRI: pkg://openindiana.org/application/management/zabbix-agent@6.2.7-2023.0.0.0:20230227T190250Z
   Project URL: http://www.zabbix.com/
    Source URL: https://cdn.zabbix.com/zabbix/sources/stable/6.2/zabbix-6.2.7.tar.gz
$

I am not sure about the dependencies of zabbix-proxy, though. It may share its dependencies with one of the others and could be put together with that then. If we don't split the packages an installation that only needs zabbix-agent will also have to install the heavy dependencies of zabbix-server which is most probably not wanted.

Packages are already split:

$ jq -r '.fmris' components/network/zabbix/pkg5 
[
  "application/management/zabbix-agent",
  "application/management/zabbix-proxy",
  "application/management/zabbix-server"
]
$

The application/management/zabbix-agent@7.0.1-2024.0.0.0:20240813T203127Z package does not require the application/management/zabbix-server package and so you can easily install zabbix-agent without zabbix-server.

@AndWac

AndWac commented Aug 15, 2024 via email

Copy link
Copy Markdown
Contributor

@mtelka

mtelka commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

Ok, I was wrong regarding the zabbix-agent dependencies. The package doesn't inherit the same dependencies that are stated in pkg5. I misattributed the dependencies metadata in the pkg5 file. In fact it describes the build dependencies only, not the runtime dependencies. I don't know if anybody is using this data, though. We also lack documentation for it as far as I can see.

Yes, exactly. The dependencies listed in pkg5 are just build dependencies. It is usually just the list produced by gmake print-value-REQUIRED_PACKAGES.

AFAIK, nobody is currently actively using neither dependencies nor name from pkg5 files. IIRC, they were aimed to be used by some old (currently abandoned?) project(s). Maybe #6392 is related to that.

BTW, the issue with ICU mentioned here is already solved. I believe that the need for the mass rebuild of components (because of some other component changed) is wrong by design. Especially for rolling releases like OI Hipster. But I'm afraid I went too off topic here, so I should stop :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants