Skip to content
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

Update smartmontool version >= v7.4 #17635

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Update smartmontool version >= v7.4 #17635

merged 2 commits into from
Feb 12, 2024

Conversation

prgeor
Copy link
Contributor

@prgeor prgeor commented Dec 28, 2023

Why I did it

Update smartmontool verson to 7.4. This is done to prevent smartmontools service to exit with non-zero exit status on platform that does not have a SSD/disk to be monitored.

Until Debian Bullseye (which had smartmontools 7.2), Debian had a patch applied that changed the default quit mode to never exit. A bug report was filed on Debian, saying that the source code patch isn't needed and could just be done via command line options, and also that smartmontools 7.3 has a new built-in option to exit with 0 if there are no monitorable devices found (which prevents systemd from treating it as a service failure). Because of that, Debian Bookworm (which also upgraded to 7.3) removed the patch and restored the default behavior of exiting with exit code 17 if there are no devices found.

Smartmontools v7.3 has this issue, because of which smartd exits with non-zero exit status even with "-q" option.

Work item tracking
  • Microsoft ADO (number only):

How I did it

  1. Update the smartmontools to version 7.4 which has the fix for exiting gracefully if no monitoring device is found
  2. Added smartd option "-q nodev0" to allow smartd to exit with status 0 if no monitoring device found

How to verify it

smartd running version is now v7.4 (stable on bookworm is v7.3)

image

Smartd is now exiting successfully (exit status=0) if no SSD device found

image

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Comment on lines 362 to 363
echo "deb http://deb.debian.org/debian bookworm-backports main" | sudo tee -a $FILESYSTEM_ROOT/etc/apt/sources.list > /dev/null
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get update
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sources.list is generated based on this template:

deb [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }}-backports main contrib {{ nonfree_component }}

So you just need to install this package and copy config file without any additional actions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k-v1 your suggestion is not working

image

Here is the latest build failure :- https://dev.azure.com/mssonic/be1b070f-be15-4154-aade-b1d3bfb17054/_apis/build/builds/457492/logs/58

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default all SONiC builds on github use these options:
SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker
and
MIRROR_SNAPSHOT=y

It means we use not default debian mirror like deb.debian.org but snapshot from here https://github.com/sonic-net/sonic-buildimage/blob/master/files/build/versions/default/versions-mirror
You build failed because your version of smartmontools (smartmontools=7.4-2~bpo12+1) is not available for current snapshot (http://packages.trafficmanager.net/snapshot/debian/20231027T000138Z bookworm-backports).

So my suggestion is correct and you may also remove apt-get update from your patch.
But you probably need ask help from someone (maybe @xumia) to update version of debian snapshot in files/build/versions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I'm not sure it's correct to lock version if you install this package from debian mirror.
If you need a specific version of smartmontools like 7.4-2 you should build the package from source.
If you need to install this package from debian bookworm-backports you should use command apt-get -y install -t bookworm-backports smartmontools (without version).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the version upgrade pipeline has been failing on master branch at least since October, because Barefoot is failing to build.

@xumia @lguohan can we disable the Barefoot build for 202311 and master, considering that platform has been failing to build for months? Looks like the SAI library for that platform needs to be updated.

sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install smartmontools
echo "deb http://deb.debian.org/debian bookworm-backports main" | sudo tee -a $FILESYSTEM_ROOT/etc/apt/sources.list > /dev/null
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get update
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -t bookworm-backports smartmontools=7.4-2~bpo12+1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last time we updated smartmontools, it brought many dependencies which was hard to manage later.

in this case, what else dependency package it got installed? can you share the log?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lguohan this is for 202311 for comparison, let me share for master (bookworm)

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lguohan on master(bookworm) running

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you get the version to see what else we are bringing from backport repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root@str3-7060-acs-1:~# apt-cache show smartmontools | grep Depends Depends: debianutils (>= 2.2), lsb-base (>= 3.2-14), libc6 (>= 2.27), libcap-ng0 (>= 0.7.9), libgcc-s1 (>= 3.0), libselinux1 (>= 3.1~), libstdc++6 (>= 5.2), libsystemd0

Copy link
Contributor Author

@prgeor prgeor Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lguohan below is the dependent versions in 202305

admin@str3-7060-acs-2:~$ apt-cache show smartmontools | grep Depends
Depends: debianutils (>= 2.2), lsb-base (>= 3.2-14), libc6 (>= 2.27), libcap-ng0 (>= 0.7.9), libgcc-s1 (>= 3.0), libselinux1 (>= 3.1~), libstdc++6 (>= 5.2), libsystemd0 admin@str3-7060-acs-2:~$

@prgeor prgeor changed the title Update smartmontool version to v7.4 Update smartmontool version >= v7.4 Feb 4, 2024
@lguohan lguohan enabled auto-merge (squash) February 12, 2024 17:36
@lguohan lguohan merged commit 0564ce4 into sonic-net:master Feb 12, 2024
19 checks passed
sonic-otn pushed a commit to Weitang-Zheng/sonic-buildimage that referenced this pull request Mar 11, 2024
Why I did it
Update smartmontool verson to 7.4. This is done to prevent smartmontools service to exit with non-zero exit status on platform that does not have a SSD/disk to be monitored.

Until Debian Bullseye (which had smartmontools 7.2), Debian had a patch applied that changed the default quit mode to never exit. A bug report was filed on Debian, saying that the source code patch isn't needed and could just be done via command line options, and also that smartmontools 7.3 has a new built-in option to exit with 0 if there are no monitorable devices found (which prevents systemd from treating it as a service failure). Because of that, Debian Bookworm (which also upgraded to 7.3) removed the patch and restored the default behavior of exiting with exit code 17 if there are no devices found.

Smartmontools v7.3 has this issue, because of which smartd exits with non-zero exit status even with "-q" option.

How I did it
Update the smartmontools to version 7.4 which has the fix for exiting gracefully if no monitoring device is found
Added smartd option "-q nodev0" to allow smartd to exit with status 0 if no monitoring device found
saksarav-nokia pushed a commit to saksarav-nokia/sonic-buildimage that referenced this pull request Mar 12, 2024
Why I did it
Update smartmontool verson to 7.4. This is done to prevent smartmontools service to exit with non-zero exit status on platform that does not have a SSD/disk to be monitored.

Until Debian Bullseye (which had smartmontools 7.2), Debian had a patch applied that changed the default quit mode to never exit. A bug report was filed on Debian, saying that the source code patch isn't needed and could just be done via command line options, and also that smartmontools 7.3 has a new built-in option to exit with 0 if there are no monitorable devices found (which prevents systemd from treating it as a service failure). Because of that, Debian Bookworm (which also upgraded to 7.3) removed the patch and restored the default behavior of exiting with exit code 17 if there are no devices found.

Smartmontools v7.3 has this issue, because of which smartd exits with non-zero exit status even with "-q" option.

How I did it
Update the smartmontools to version 7.4 which has the fix for exiting gracefully if no monitoring device is found
Added smartd option "-q nodev0" to allow smartd to exit with status 0 if no monitoring device found
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.

4 participants