nextcloudpi icon indicating copy to clipboard operation
nextcloudpi copied to clipboard

ncp-notify-unattended-upgrade issues wrong notifications

Open Siam1205 opened this issue 2 years ago • 0 comments

Executing the command sudo ncp-notify-unattended-upgrade always returns the same packages that seem to have automatically been updated in addition to an error message sed: can't read LOGFILE: No such file or directory on the latest nextcloudpi image from March 2022.

simon@RaspberryServer:~ $ sudo ncp-notify-unattended-upgrade
sed: can't read LOGFILE: No such file or directory
Packages automatically upgraded: apache2 apache2-bin apache2-data apache2-utils base-files bind9-dnsutils bind9-host bind9-libs dirmngr dnsutils galera-4 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv libarchive13 libcryptsetup12 libexpat1 libflac8 libmariadb3 libpam-systemd libsasl2-2 libsasl2-modules libsasl2-modules-db libssl1.1 libsystemd0 libtiff5 libudev1 libxml2 mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common mariadb-server mariadb-server-10.5 mariadb-server-core-10.5 openssl systemd systemd-sysv systemd-timesyncd sysvinit-utils tasksel tasksel-data udev zlib1g zlib1g-dev

Somehow I found the file /usr/local/bin/ncp-notify-unattended-upgrade and looked into it. I noticed the line sed -i 's|INFO Packages that will be upgraded:|INFO Packages that will be upgraded :|' \LOGFILE' is causing the issue. sed cannot find the log file thus it does not mark the packages as already read and always returns them along with the error message.

Changing it to sed -i 's|INFO Packages that will be upgraded:|INFO Packages that will be upgraded :|' $LOGFILE fixes the issue.

I don't know where the file /usr/local/bin/ncp-notify-unattended-upgrade results from because failed to find it inside the nextcloudpi repository. The only reference to the broken line that I found is this.

PS: I know it does not belong here but since this is about the unattended upgrades: Only my admin user is notified about the upgrades but no other user belonging to the group admin. Why is this? With earlier versions, all users were upgraded.

Siam1205 avatar Apr 05 '22 09:04 Siam1205