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

fix(netdata-updater): properly handle update for debian packages #12524

Merged
merged 2 commits into from Mar 28, 2022

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Mar 27, 2022

Summary

Fixes: #12525

This PR:

  • removes [ "${INSTALL_UID}" != "$(id -u)" ] check for binpkg packages (we don't create .environment file for deb).
  • changes pkg_installed_check from dpkg -l to dpkg -s, because -l doesn't really work
dpkg -l
# no netdata pacages intalled
ilyam@deb-fra1-01:~$ dpkg -l | grep netdata

# install netdata-repo-edge
ilyam@deb-fra1-01:~$ sudo apt-get install netdata-repo-edge >/dev/null


# problem, for some reason there is 'netdata-repo' but 'un' - uknown/not-intalled
ilyam@deb-fra1-01:~$ dpkg -l netdata-repo && echo $?
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  netdata-repo   <none>       <none>       (no description available)
0


ilyam@deb-fra1-01:~$ dpkg -l netdata-repo-edge && echo $?
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version      Architecture Description
+++-=================-============-============-===============================================================
ii  netdata-repo-edge 1-1          all          Configuration for the official Netdata Edge package repository.
0
dpkg -s
ilyam@deb-fra1-01:~$ dpkg -l | grep netdata
ii  netdata-repo-edge                                1-1                            all          Configuration for the official Netdata Edge package repository.

ilyam@deb-fra1-01:~$ dpkg -s netdata-repo > /dev/null 2>&1; echo $?
1

ilyam@deb-fra1-01:~$ dpkg -s netdata-repo-edge > /dev/null 2>&1; echo $?
0
Test Plan
  • install Netdata Debian package, execute the update script.
Additional Information
For users: How does this change affect me?

@github-actions github-actions bot added the area/packaging Packaging and operating systems support label Mar 27, 2022
@ilyam8 ilyam8 changed the title fix: properly handle update for debian packages fix(netdata-updater): properly handle update for debian packages Mar 27, 2022
Comment on lines +850 to 851
if echo "$INSTALL_TYPE" | grep -qv ^binpkg && [ "${INSTALL_UID}" != "$(id -u)" ]; then
fatal "You are running this script as user with uid $(id -u). We recommend to run this script as root (user with uid 0)"
Copy link
Member Author

@ilyam8 ilyam8 Mar 28, 2022

Choose a reason for hiding this comment

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

I think this check is disconnected from the fatal message, perhaps we need just to check [ $(id -u) != "0" ] here.

@ilyam8 ilyam8 merged commit df32f93 into netdata:master Mar 28, 2022
@ilyam8 ilyam8 deleted the fix_updater_for_deb branch March 28, 2022 17:29
@netdata-community-bot
Copy link

@netdata-community-bot
Copy link

This pull request has been mentioned on Netdata Forums. There might be relevant details there:

https://community.netdata.cloud/t/i-have-problem-when-i-update-new-code-update/2721/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/packaging Packaging and operating systems support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: the netdata-updater.sh script fails when executed manually on Debian
4 participants