[GH-ISSUE #8880] Problem with Zabbix LXC update script – wrong service name #1930

Closed
opened 2026-02-26 12:50:43 +03:00 by kerem · 6 comments
Owner

Originally created by @Peterkal2112 on GitHub (Nov 5, 2025).
Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/8880

Originally assigned to: @MickLesk on GitHub.

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Zabbix

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/zabbix.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 13

📈 Which Proxmox version are you on?

pve-manager/9.0.11/3bf5476b8a4699e2 (running kernel: 6.14.11-4-pve)

📝 Provide a clear and concise description of the issue.

I cannot update my Zabbix LXC container using the same community script that I originally installed it with (and which should also handle updates).
When I run the update, the script fails because it tries to stop zabbix-agent.service, but my container only has zabbix-agent2.service running.

🔄 Steps to reproduce the issue.

  1. Connect to the LXC via SSH (Zabbix was installed using the community script).
  2. Run the script again to update the LXC.
  3. Choose Yes with verbose enabled.
  4. The script attempts to stop zabbix-agent.service, which does not exist, and throws the following error:

Paste the full error output (if available).

/__  /  ____ _/ /_  / /_  (_)  __
  / /  / __ `/ __ \/ __ \/ / |/_/
 / /__/ /_/ / /_/ / /_/ / />  <
/____/\__,_/_.___/_.___/_/_/|_|


  ⏳   Stopping ServicesFailed to stop zabbix-agent.service: Unit zabbix-agent.service not loaded.

[ERROR] in line 49: exit code 0: while executing command $STD systemctl stop zabbix-agent

🖼️ Additional context (optional).

It looks like the script has the service name hardcoded and doesn’t account for zabbix-agent2.service.

My questions

  • Is this a known bug in the script?
  • Is there a recommended workaround (e.g. editing the script, adding a systemd alias), or should I wait for a fix in the repository?

It might be useful if the script could detect whether zabbix-agent or zabbix-agent2 is installed and stop the correct service accordingly.

Originally created by @Peterkal2112 on GitHub (Nov 5, 2025). Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/8880 Originally assigned to: @MickLesk on GitHub. ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Zabbix ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/zabbix.sh)" ### ⚙️ What settings are you using? - [ ] Default Settings - [x] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 13 ### 📈 Which Proxmox version are you on? pve-manager/9.0.11/3bf5476b8a4699e2 (running kernel: 6.14.11-4-pve) ### 📝 Provide a clear and concise description of the issue. I cannot update my Zabbix LXC container using the same community script that I originally installed it with (and which should also handle updates). When I run the update, the script fails because it tries to stop `zabbix-agent.service`, but my container only has `zabbix-agent2.service` running. ### 🔄 Steps to reproduce the issue. 1. Connect to the LXC via SSH (Zabbix was installed using the community script). 2. Run the script again to update the LXC. 3. Choose **Yes** with **verbose** enabled. 4. The script attempts to stop `zabbix-agent.service`, which does not exist, and throws the following error: ### ❌ Paste the full error output (if available). ``` _____ __ __ _ /__ / ____ _/ /_ / /_ (_) __ / / / __ `/ __ \/ __ \/ / |/_/ / /__/ /_/ / /_/ / /_/ / /> < /____/\__,_/_.___/_.___/_/_/|_| ⏳ Stopping ServicesFailed to stop zabbix-agent.service: Unit zabbix-agent.service not loaded. [ERROR] in line 49: exit code 0: while executing command $STD systemctl stop zabbix-agent ``` ### 🖼️ Additional context (optional). It looks like the script has the service name hardcoded and doesn’t account for `zabbix-agent2.service`. ## My questions - Is this a known bug in the script? - Is there a recommended workaround (e.g. editing the script, adding a systemd alias), or should I wait for a fix in the repository? It might be useful if the script could detect whether `zabbix-agent` or `zabbix-agent2` is installed and stop the correct service accordingly.
kerem 2026-02-26 12:50:43 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@MickLesk commented on GitHub (Nov 5, 2025):

do you have agent2 or agent? nvm. agent2 - okay. can you share output of: systemctl list-unit-files

<!-- gh-comment-id:3491366631 --> @MickLesk commented on GitHub (Nov 5, 2025): do you have agent2 or agent? nvm. agent2 - okay. can you share output of: systemctl list-unit-files
Author
Owner

@Peterkal2112 commented on GitHub (Nov 5, 2025):

I have only agent2.
I do not have agent (1) installed at all — I went straight with agent2 during the initial setup.

<!-- gh-comment-id:3491374253 --> @Peterkal2112 commented on GitHub (Nov 5, 2025): I have only **agent2**. I do not have agent (1) installed at all — I went straight with agent2 during the initial setup.
Author
Owner

@tremor021 commented on GitHub (Nov 5, 2025):

if systemctl list-unit-files | grep -q zabbix-agent2.service; then
    AGENT_SERVICE="zabbix-agent2"
  else
    AGENT_SERVICE="zabbix-agent"
  fi

  msg_info "Stopping Services"
  $STD systemctl stop zabbix-server
  if systemctl list-unit-files | grep -q zabbix-agent2; then
    $STD systemctl stop zabbix-agent2
  else
    $STD systemctl stop zabbix-agent
  fi
  msg_ok "Stopped Services"

The update script actually checks if you have agent or agent2... weird

<!-- gh-comment-id:3491386358 --> @tremor021 commented on GitHub (Nov 5, 2025): ```bash if systemctl list-unit-files | grep -q zabbix-agent2.service; then AGENT_SERVICE="zabbix-agent2" else AGENT_SERVICE="zabbix-agent" fi msg_info "Stopping Services" $STD systemctl stop zabbix-server if systemctl list-unit-files | grep -q zabbix-agent2; then $STD systemctl stop zabbix-agent2 else $STD systemctl stop zabbix-agent fi msg_ok "Stopped Services" ``` The update script actually checks if you have agent or agent2... weird
Author
Owner

@MickLesk commented on GitHub (Nov 5, 2025):

fixed with #8881

<!-- gh-comment-id:3491387240 --> @MickLesk commented on GitHub (Nov 5, 2025): fixed with #8881
Author
Owner

@Peterkal2112 commented on GitHub (Nov 5, 2025):

Wow.... this was super fast, you are the best.

<!-- gh-comment-id:3491408286 --> @Peterkal2112 commented on GitHub (Nov 5, 2025): Wow.... this was super fast, you are the best.
Author
Owner

@Peterkal2112 commented on GitHub (Nov 5, 2025):

I can confirm now, it is now working and successfully upgrading:

 _____         __    __    _
/__  /  ____ _/ /_  / /_  (_)  __
  / /  / __ `/ __ \/ __ \/ / |/_/
 / /__/ /_/ / /_/ / /_/ / />  <
/____/\__,_/_.___/_.___/_/_/|_|


  ✔️   Stopped Services
(Reading database ... 28616 files and directories currently installed.)
Preparing to unpack zabbix-release_latest+debian13_all.deb ...
Unpacking zabbix-release (1:8.0-0.1+debian13) over (1:7.4-1+debian13) ...
Setting up zabbix-release (1:8.0-0.1+debian13) ...
Installing new version of config file /etc/apt/sources.list.d/zabbix-release.list ...
Installing new version of config file /etc/apt/sources.list.d/zabbix-unstable.list ...
Hit:1 http://security.debian.org trixie-security InRelease
Get:2 https://apt.postgresql.org/pub/repos/apt trixie-pgdg InRelease [107 kB]
Hit:3 http://deb.debian.org/debian trixie InRelease
Hit:4 http://deb.debian.org/debian trixie-updates InRelease
Get:5 https://apt.postgresql.org/pub/repos/apt trixie-pgdg/main arm64 Packages [337 kB]
Get:6 https://apt.postgresql.org/pub/repos/apt trixie-pgdg/main amd64 Packages [350 kB]
Get:7 https://repo.zabbix.com/zabbix/8.0/release/debian trixie InRelease [2,425 B]
Hit:8 https://repo.zabbix.com/zabbix-tools/debian-ubuntu trixie InRelease
Get:9 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie InRelease [3,889 B]
Get:10 https://repo.zabbix.com/zabbix/8.0/release/debian trixie/main Sources [519 B]
Get:11 https://repo.zabbix.com/zabbix/8.0/release/debian trixie/main all Packages [411 B]
Get:12 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main Sources [2,966 B]
Get:13 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main all Packages [1,415 B]
Get:14 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main amd64 Packages [5,091 B]
Fetched 810 kB in 1s (599 kB/s)
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
php8.4-pgsql is already the newest version (8.4.11-1).
Upgrading:
  zabbix-agent2  zabbix-apache-conf  zabbix-frontend-php  zabbix-server-pgsql  zabbix-sql-scripts

Summary:
  Upgrading: 5, Installing: 0, Removing: 0, Not Upgrading: 1
  Download size: 44.4 MB
  Space needed: 19.0 MB / 33.8 GB available

Continue? [Y/n] y
Get:1 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main amd64 zabbix-server-pgsql amd64 1:8.0.0~alpha1-1+debian13 [2,381 kB]
Get:2 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main amd64 zabbix-agent2 amd64 1:8.0.0~alpha1-1+debian13 [6,170 kB]
Get:3 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main all zabbix-frontend-php all 1:8.0.0~alpha1-1+debian13 [26.6 MB]
Get:4 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main all zabbix-apache-conf all 1:8.0.0~alpha1-1+debian13 [517 kB]
Get:5 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main all zabbix-sql-scripts all 1:8.0.0~alpha1-1+debian13 [8,716 kB]
Fetched 44.4 MB in 4s (10.7 MB/s)
Reading changelogs... Done
(Reading database ... 28615 files and directories currently installed.)
Preparing to unpack .../zabbix-server-pgsql_1%3a8.0.0~alpha1-1+debian13_amd64.deb ...
Unpacking zabbix-server-pgsql (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ...
Preparing to unpack .../zabbix-agent2_1%3a8.0.0~alpha1-1+debian13_amd64.deb ...
Unpacking zabbix-agent2 (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ...
Preparing to unpack .../zabbix-frontend-php_1%3a8.0.0~alpha1-1+debian13_all.deb ...
Unpacking zabbix-frontend-php (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ...
Preparing to unpack .../zabbix-apache-conf_1%3a8.0.0~alpha1-1+debian13_all.deb ...
Unpacking zabbix-apache-conf (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ...
Preparing to unpack .../zabbix-sql-scripts_1%3a8.0.0~alpha1-1+debian13_all.deb ...
Unpacking zabbix-sql-scripts (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ...
Setting up zabbix-sql-scripts (1:8.0.0~alpha1-1+debian13) ...
Setting up zabbix-frontend-php (1:8.0.0~alpha1-1+debian13) ...
Setting up zabbix-server-pgsql (1:8.0.0~alpha1-1+debian13) ...
Setting up zabbix-agent2 (1:8.0.0~alpha1-1+debian13) ...
Installing new version of config file /etc/zabbix/zabbix_agent2.d/plugins.d/oracle.conf ...
Installing new version of config file /etc/zabbix/zabbix_agent2.d/plugins.d/redis.conf ...
Setting up zabbix-apache-conf (1:8.0.0~alpha1-1+debian13) ...
Processing triggers for man-db (2.13.1-1) ...
zabbix-agent2 is already the newest version (1:8.0.0~alpha1-1+debian13).
Upgrading:
  zabbix-agent2-plugin-postgresql

Summary:
  Upgrading: 1, Installing: 0, Removing: 0, Not Upgrading: 0
  Download size: 2,836 kB
  Space needed: 43.0 kB / 33.8 GB available

Continue? [Y/n] y
Get:1 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main amd64 zabbix-agent2-plugin-postgresql amd64 1:8.0.0~alpha1-1+debian13 [2,836 kB]
Fetched 2,836 kB in 2s (1,584 kB/s)
Reading changelogs... Done
(Reading database ... 28668 files and directories currently installed.)
Preparing to unpack .../zabbix-agent2-plugin-postgresql_1%3a8.0.0~alpha1-1+debian13_amd64.deb ...
Unpacking zabbix-agent2-plugin-postgresql (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ...
Setting up zabbix-agent2-plugin-postgresql (1:8.0.0~alpha1-1+debian13) ...
  ✔️   Updated Zabbix
  ✔️   Started Services
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
  ✔️   Cleaned
  ✔️   Updated successfully!
<!-- gh-comment-id:3491413309 --> @Peterkal2112 commented on GitHub (Nov 5, 2025): I can confirm now, it is now working and successfully upgrading: ``` _____ __ __ _ /__ / ____ _/ /_ / /_ (_) __ / / / __ `/ __ \/ __ \/ / |/_/ / /__/ /_/ / /_/ / /_/ / /> < /____/\__,_/_.___/_.___/_/_/|_| ✔️ Stopped Services (Reading database ... 28616 files and directories currently installed.) Preparing to unpack zabbix-release_latest+debian13_all.deb ... Unpacking zabbix-release (1:8.0-0.1+debian13) over (1:7.4-1+debian13) ... Setting up zabbix-release (1:8.0-0.1+debian13) ... Installing new version of config file /etc/apt/sources.list.d/zabbix-release.list ... Installing new version of config file /etc/apt/sources.list.d/zabbix-unstable.list ... Hit:1 http://security.debian.org trixie-security InRelease Get:2 https://apt.postgresql.org/pub/repos/apt trixie-pgdg InRelease [107 kB] Hit:3 http://deb.debian.org/debian trixie InRelease Hit:4 http://deb.debian.org/debian trixie-updates InRelease Get:5 https://apt.postgresql.org/pub/repos/apt trixie-pgdg/main arm64 Packages [337 kB] Get:6 https://apt.postgresql.org/pub/repos/apt trixie-pgdg/main amd64 Packages [350 kB] Get:7 https://repo.zabbix.com/zabbix/8.0/release/debian trixie InRelease [2,425 B] Hit:8 https://repo.zabbix.com/zabbix-tools/debian-ubuntu trixie InRelease Get:9 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie InRelease [3,889 B] Get:10 https://repo.zabbix.com/zabbix/8.0/release/debian trixie/main Sources [519 B] Get:11 https://repo.zabbix.com/zabbix/8.0/release/debian trixie/main all Packages [411 B] Get:12 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main Sources [2,966 B] Get:13 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main all Packages [1,415 B] Get:14 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main amd64 Packages [5,091 B] Fetched 810 kB in 1s (599 kB/s) 6 packages can be upgraded. Run 'apt list --upgradable' to see them. php8.4-pgsql is already the newest version (8.4.11-1). Upgrading: zabbix-agent2 zabbix-apache-conf zabbix-frontend-php zabbix-server-pgsql zabbix-sql-scripts Summary: Upgrading: 5, Installing: 0, Removing: 0, Not Upgrading: 1 Download size: 44.4 MB Space needed: 19.0 MB / 33.8 GB available Continue? [Y/n] y Get:1 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main amd64 zabbix-server-pgsql amd64 1:8.0.0~alpha1-1+debian13 [2,381 kB] Get:2 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main amd64 zabbix-agent2 amd64 1:8.0.0~alpha1-1+debian13 [6,170 kB] Get:3 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main all zabbix-frontend-php all 1:8.0.0~alpha1-1+debian13 [26.6 MB] Get:4 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main all zabbix-apache-conf all 1:8.0.0~alpha1-1+debian13 [517 kB] Get:5 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main all zabbix-sql-scripts all 1:8.0.0~alpha1-1+debian13 [8,716 kB] Fetched 44.4 MB in 4s (10.7 MB/s) Reading changelogs... Done (Reading database ... 28615 files and directories currently installed.) Preparing to unpack .../zabbix-server-pgsql_1%3a8.0.0~alpha1-1+debian13_amd64.deb ... Unpacking zabbix-server-pgsql (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ... Preparing to unpack .../zabbix-agent2_1%3a8.0.0~alpha1-1+debian13_amd64.deb ... Unpacking zabbix-agent2 (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ... Preparing to unpack .../zabbix-frontend-php_1%3a8.0.0~alpha1-1+debian13_all.deb ... Unpacking zabbix-frontend-php (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ... Preparing to unpack .../zabbix-apache-conf_1%3a8.0.0~alpha1-1+debian13_all.deb ... Unpacking zabbix-apache-conf (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ... Preparing to unpack .../zabbix-sql-scripts_1%3a8.0.0~alpha1-1+debian13_all.deb ... Unpacking zabbix-sql-scripts (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ... Setting up zabbix-sql-scripts (1:8.0.0~alpha1-1+debian13) ... Setting up zabbix-frontend-php (1:8.0.0~alpha1-1+debian13) ... Setting up zabbix-server-pgsql (1:8.0.0~alpha1-1+debian13) ... Setting up zabbix-agent2 (1:8.0.0~alpha1-1+debian13) ... Installing new version of config file /etc/zabbix/zabbix_agent2.d/plugins.d/oracle.conf ... Installing new version of config file /etc/zabbix/zabbix_agent2.d/plugins.d/redis.conf ... Setting up zabbix-apache-conf (1:8.0.0~alpha1-1+debian13) ... Processing triggers for man-db (2.13.1-1) ... zabbix-agent2 is already the newest version (1:8.0.0~alpha1-1+debian13). Upgrading: zabbix-agent2-plugin-postgresql Summary: Upgrading: 1, Installing: 0, Removing: 0, Not Upgrading: 0 Download size: 2,836 kB Space needed: 43.0 kB / 33.8 GB available Continue? [Y/n] y Get:1 https://repo.zabbix.com/zabbix/8.0/unstable/debian trixie/main amd64 zabbix-agent2-plugin-postgresql amd64 1:8.0.0~alpha1-1+debian13 [2,836 kB] Fetched 2,836 kB in 2s (1,584 kB/s) Reading changelogs... Done (Reading database ... 28668 files and directories currently installed.) Preparing to unpack .../zabbix-agent2-plugin-postgresql_1%3a8.0.0~alpha1-1+debian13_amd64.deb ... Unpacking zabbix-agent2-plugin-postgresql (1:8.0.0~alpha1-1+debian13) over (1:7.4.3-1+debian13) ... Setting up zabbix-agent2-plugin-postgresql (1:8.0.0~alpha1-1+debian13) ... ✔️ Updated Zabbix ✔️ Started Services Summary: Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0 ✔️ Cleaned ✔️ Updated successfully! ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#1930
No description provided.