Connection synchronization daemon fails at start due to a bug in launch script

Bug #1830033 reported by Andrii on 2019-05-22
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ipvsadm (Debian)
Fix Released
Unknown
ipvsadm (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned

Bug Description

[Impact]

 * the init script has an argument twice, which makes the service fail to
   start

 * Without the fix the service is rather unusable as it can't be started

[Test Case]

 * Needs a VM (no container)
   $ sudo apt install ipvsadm
   $ echo 'AUTO="true"' | sudo tee -a /etc/default/ipvsadm
   $ echo 'DAEMON="master"' | sudo tee -a /etc/default/ipvsadm
   $ sudo systemctl restart ipvsadm
   $ systemctl status ipvsadm

   With the bug this will show the sevrice failing
   [...]
   Try `/sbin/ipvsadm -h' or '/sbin/ipvsadm --help' for more information.
   ...fail!

[Regression Potential]

 * Even in the default config (just enabling it to run) this doesn't work.
   Hence the risk should be next to none.
   I can think of setups that "are meant to work" , but so far "didn't
   start" now properly would start. For example if someone
   configured the service but ignored that it failed to start.
   I hope and expect that this is a rather unimportant risk, it actually
   is the fix we are intending to make.

[Other Info]

 * TBH it is in main for a dependency from keepalive but I wonder how much
   that could be a sugegsts instead. But that is for the future.

---

The launch script for ipvsadm has a bug that prevents LVS from start in synchronization mode.

How to reproduce.
1. Install ipvsadm on ubuntu server 16.04 and modify /etc/default/ipvsadm to lauch LVS in master mode (or backup):
AUTO="true"
DAEMON="master"
IFACE="eno1"
SYNCID="0"

2. Start "ipvsadm" service and check systemd unit log:
# systemctl start ipvsadm
# journalctl -u ipvsadm
What you expected to happen
The log output without error:
May 22 12:41:46 xxxxxxxxxxx systemd[1]: Starting LSB: ipvsadm daemon...
May 22 12:41:46 xxxxxxxxxxx ipvsadm[4619]: * Clearing the current IPVS table...
May 22 12:41:46 xxxxxxxxxxx ipvsadm[4619]: ...done.
May 22 12:41:46 xxxxxxxxxxx ipvsadm[4619]: * Loading IPVS configuration...
May 22 12:41:46 xxxxxxxxxxx ipvsadm[4619]: ...done.
May 22 12:41:46 xxxxxxxxxxx ipvsadm[4619]: * Starting IPVS Connection Synchronization Daemon master
May 22 12:41:46 xxxxxxxxxxx ipvsadm[4619]: ...done.
May 22 12:41:46 xxxxxxxxxxx systemd[1]: Started LSB: ipvsadm daemon.

What happened instead:
May 22 12:32:59 xxxxxxx systemd[1]: Starting LSB: ipvsadm daemon...
May 22 12:32:59 xxxxxxx ipvsadm[15743]: * Clearing the current IPVS table...
May 22 12:32:59 xxxxxxx ipvsadm[15743]: ...done.
May 22 12:32:59 xxxxxxx ipvsadm[15743]: * Loading IPVS configuration...
May 22 12:32:59 xxxxxxx ipvsadm[15743]: ...done.
May 22 12:32:59 xxxxxxx ipvsadm[15743]: * Starting IPVS Connection Synchronization Daemon master
May 22 12:32:59 xxxxxxx ipvsadm[15743]: Try `/sbin/ipvsadm -h' or '/sbin/ipvsadm --help' for more information.
May 22 12:32:59 xxxxxxx ipvsadm[15743]: ...fail!
May 22 12:32:59 xxxxxxx ipvsadm[15743]: ...done.
May 22 12:32:59 xxxxxxx systemd[1]: Started LSB: ipvsadm daemon.

As you can see in log output, there is an message: "Try `/sbin/ipvsadm -h' or '/sbin/ipvsadm --help' for more information". This message relates to bug in script /etc/init.d/ipvsadm.

Here a difference how script should be updated to get it work:
--- /etc/init.d/ipvsadm 2019-05-22 12:41:34.429916226 +0000
+++ /root/ipvsadm 2019-05-22 11:18:04.307344255 +0000
@@ -29,16 +29,16 @@
     case $DAEMON in
  master|backup)
      log_daemon_msg "Starting IPVS Connection Synchronization Daemon" "$DAEMON"
- $IPVSADM --start-daemon $DAEMON --mcast-interface \
+ $IPVSADM --syncid $SYNCID --start-daemon $DAEMON --mcast-interface \
         $IFACE --syncid $SYNCID || log_end_msg 1
      log_end_msg 0
      ;;
  both)
      log_daemon_msg "Starting IPVS Connection Synchronization Daemon" "master"
- $IPVSADM --start-daemon master --mcast-interface \
+ $IPVSADM --syncid $SYNCID --start-daemon master --mcast-interface \
         $IFACE --syncid $SYNCID || FAILURE=1
      log_progress_msg "backup"
- $IPVSADM --start-daemon backup --mcast-interface \
+ $IPVSADM --syncid $SYNCID --start-daemon backup --mcast-interface \
         $IFACE --syncid $SYNCID || FAILURE=1
      if [ "$FAILURE" -eq 1 ]
      then

/root/ipvsadm - this is an original script from ipvsadm package

# lsb_release -rd
Description: Ubuntu 16.04.6 LTS
Release: 16.04
# apt-cache policy ipvsadm
ipvsadm:
  Installed: 1:1.28-3
  Candidate: 1:1.28-3
  Version table:
 *** 1:1.28-3 500
        500 http://nl.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

Related branches

Paride Legovini (legovini) wrote :

Thanks for your report. This has been fixed in Debian version 1.29-1 by

https://salsa.debian.org/ipvs-team/pkg-ipvsadm/commit/aa1dc89fb8712d45df9141264066fb5dfe139cb2

and therefore in Ubuntu Cosmic and newer. The fix qualifies to be ported to Xenial and Bionic.

tags: added: server-next
Changed in ipvsadm (Ubuntu Cosmic):
status: New → Fix Released
no longer affects: ipvsadm (Ubuntu Disco)
no longer affects: ipvsadm (Ubuntu Eoan)
no longer affects: ipvsadm (Ubuntu Disco)
Changed in ipvsadm (Ubuntu Xenial):
status: New → Triaged
Changed in ipvsadm (Ubuntu):
status: New → Triaged
Changed in ipvsadm (Ubuntu Bionic):
status: New → Triaged
Changed in ipvsadm (Debian):
status: Unknown → Fix Released
description: updated

I verified the proposed change (which is in the opposite diff direction in the initial report) works in VMs and the PPA fixes the issue.

The fix seems easy enough, so I added MPs for Xenial and Bionic and a PPA with the builds at [1]

[1]: https://launchpad.net/~paelzer/+archive/ubuntu/bug-1830033-ipvsadm-start

Changed in ipvsadm (Ubuntu):
status: Triaged → Fix Released

Both MPs approved, this is now uploaded to the SRU queue, see [1] for more details on how this is usually processed.

[1]: https://wiki.ubuntu.com/StableReleaseUpdates

Hello Andrii, or anyone else affected,

Accepted ipvsadm into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ipvsadm/1:1.28-3ubuntu0.18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ipvsadm (Ubuntu Bionic):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-bionic
Changed in ipvsadm (Ubuntu Xenial):
status: Triaged → Fix Committed
tags: added: verification-needed-xenial
Brian Murray (brian-murray) wrote :

Hello Andrii, or anyone else affected,

Accepted ipvsadm into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ipvsadm/1:1.28-3ubuntu0.16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Download full text (21.8 KiB)

Testing Xenial:
ubuntu@xenial-ipvsadm:~$ sudo apt update; sudo apt install ipvsadm
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [647 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7532 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [264 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [435 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [176 kB]
Get:10 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [5600 B]
Get:11 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [2676 B]
Get:12 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4354 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [957 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [381 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [749 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [311 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.7 kB]
Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8440 B]
Get:21 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [7280 B]
Get:22 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [4456 B]
Get:23 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [7804 B] ...

tags: added: verification-done verification-done-bionic verification-done-xenial
removed: verification-needed verification-needed-bionic verification-needed-xenial
Andrii (comachada) wrote :
Download full text (4.8 KiB)

Hello everyone.
I also tested proposed package and it works fine for me on Xenial.
Checked "master", "backup", "both", "none" daemon mode:

root@test_lvs:~# echo -e "AUTO="true"\nDAEMON="master"\nIFACE="eth0"" > /etc/default/ipvsadm
root@test_lvs:~# systemctl restart ipvsadm ; ps aux | grep ipvs
root 3135 0.0 0.0 0 0 ? S 05:22 0:00 [ipvs-m:0:0]
root 3138 0.0 0.0 12944 1012 pts/0 S+ 05:22 0:00 grep --color=auto ipvs
root@test_lvs:~# journalctl -u ipvsadm | tail -n 10
May 29 05:21:44 test_lvs systemd[1]: Stopped LSB: ipvsadm daemon.
May 29 05:22:14 test_lvs systemd[1]: Stopped LSB: ipvsadm daemon.
May 29 05:22:14 test_lvs systemd[1]: Starting LSB: ipvsadm daemon...
May 29 05:22:14 test_lvs ipvsadm[3126]: * Clearing the current IPVS table...
May 29 05:22:14 test_lvs ipvsadm[3126]: ...done.
May 29 05:22:14 test_lvs ipvsadm[3126]: * Loading IPVS configuration...
May 29 05:22:14 test_lvs ipvsadm[3126]: ...done.
May 29 05:22:14 test_lvs ipvsadm[3126]: * Starting IPVS Connection Synchronization Daemon master
May 29 05:22:14 test_lvs ipvsadm[3126]: ...done.
May 29 05:22:14 test_lvs systemd[1]: Started LSB: ipvsadm daemon.
root@test_lvs:~# systemctl stop ipvsadm
root@test_lvs:~# echo -e "AUTO="true"\nDAEMON="backup"\nIFACE="eth0"" > /etc/default/ipvsadm
root@test_lvs:~# systemctl restart ipvsadm ; ps aux | grep ipvs
root 3166 0.0 0.0 0 0 ? S 05:22 0:00 [ipvs-b:0:0]
root 3169 0.0 0.0 12944 988 pts/0 S+ 05:22 0:00 grep --color=auto ipvs
root@test_lvs:~# journalctl -u ipvsadm | tail -n 10
May 29 05:22:25 test_lvs systemd[1]: Stopped LSB: ipvsadm daemon.
May 29 05:22:42 test_lvs systemd[1]: Stopped LSB: ipvsadm daemon.
May 29 05:22:42 test_lvs systemd[1]: Starting LSB: ipvsadm daemon...
May 29 05:22:42 test_lvs ipvsadm[3156]: * Clearing the current IPVS table...
May 29 05:22:42 test_lvs ipvsadm[3156]: ...done.
May 29 05:22:42 test_lvs ipvsadm[3156]: * Loading IPVS configuration...
May 29 05:22:42 test_lvs ipvsadm[3156]: ...done.
May 29 05:22:42 test_lvs ipvsadm[3156]: * Starting IPVS Connection Synchronization Daemon backup
May 29 05:22:42 test_lvs ipvsadm[3156]: ...done.
May 29 05:22:42 test_lvs systemd[1]: Started LSB: ipvsadm daemon.
root@test_lvs:~# echo -e "AUTO="true"\nDAEMON="both"\nIFACE="eth0"" > /etc/default/ipvsadm
root@test_lvs:~# systemctl stop ipvsadm
root@test_lvs:~# systemctl restart ipvsadm ; ps aux | grep ipvs
root 3201 0.0 0.0 0 0 ? S 05:23 0:00 [ipvs-m:0:0]
root 3203 0.0 0.0 0 0 ? S 05:23 0:00 [ipvs-b:0:0]
root 3206 0.0 0.0 12944 968 pts/0 S+ 05:23 0:00 grep --color=auto ipvs
root@test_lvs:~# journalctl -u ipvsadm | tail -n 10
May 29 05:23:10 test_lvs systemd[1]: Stopped LSB: ipvsadm daemon.
May 29 05:23:14 test_lvs systemd[1]: Stopped LSB: ipvsadm daemon.
May 29 05:23:14 test_lvs systemd[1]: Starting LSB: ipvsadm daemon...
May 29 05:23:14 test_lvs ipvsadm[3191]: * Clearing the current IPVS table...
May 29 05:23:14 test_lvs ipvsadm[3191]: ...done.
May 29 05:23:14 test_lvs ipvsadm[3191]: * Loading IPVS configuration...
May 29 05:23:14 test_lvs i...

Read more...

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ipvsadm - 1:1.28-3ubuntu0.18.04.1

---------------
ipvsadm (1:1.28-3ubuntu0.18.04.1) bionic; urgency=medium

  * d/ipvsadm.init: remove duplicate syncid on daemon invocation (LP: #1830033)

 -- Christian Ehrhardt <email address hidden> Fri, 24 May 2019 09:51:59 +0200

Changed in ipvsadm (Ubuntu Bionic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for ipvsadm has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ipvsadm - 1:1.28-3ubuntu0.16.04.1

---------------
ipvsadm (1:1.28-3ubuntu0.16.04.1) xenial; urgency=medium

  * d/ipvsadm.init: remove duplicate syncid on daemon invocation (LP: #1830033)

 -- Christian Ehrhardt <email address hidden> Fri, 24 May 2019 09:51:59 +0200

Changed in ipvsadm (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.