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

The script /etc/cron.daily/dietpi can't reach G_AGUP function and it is exiting prematurely #6651

Closed
lz1aam opened this issue Sep 30, 2023 · 3 comments
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Milestone

Comments

@lz1aam
Copy link

lz1aam commented Sep 30, 2023

Creating a bug report/issue

Required Information

  • DietPi version | v8.22.3;
  • Distro version | Bullseye;
  • Kernel version | 6.1.21-v8+;
  • SBC model | RPi Zero 2 W;

Steps to reproduce

  1. Set CONFIG_CHECK_DIETPI_UPDATES= in /boot/dietpi.txt to 0;
  2. Run /etc/cron.daily/dietpi;

Expected behaviour

  • The script /etc/cron.daily/dietpi shouldn't exit prematurely;

Actual behaviour

  • The script /etc/cron.daily/dietpi can't reach G_AGUP function from line 31 and it is exiting prematurely with:

    /etc/cron.daily/dietpi: line 31: G_AGUP: command not found

Extra details

  • Adding the extra line source /boot/dietpi/dietpi-update just before line 31: G_AGUP -f in /etc/cron.daily/dietpi solves the issue.
@MichaIng MichaIng added this to the v8.23 milestone Sep 30, 2023
@MichaIng MichaIng added the Solution available 🥂 Definite solution has been done label Sep 30, 2023
MichaIng added a commit that referenced this issue Sep 30, 2023
- DietPi daily cron | Resolved an issue where daily APT update checks failed if daily DietPi update checks were disabled. Many thanks to @lz1aam for reporting this issue: #6651
@MichaIng
Copy link
Owner

Many thanks for your report.

Indeed dietpi-globals are missing there, crazy that this was never detected until now. Seems like this config combination is rare.

The script however should not exit prematurely, does it? It just continues on error, but the intended APT update check is indeed missing then.

You should not source /boot/dietpi/dietpi-update, but the globals only:

. /boot/dietpi/func/dietpi-globals

Fixed for next DietPi version with: b04b43b

@lz1aam
Copy link
Author

lz1aam commented Sep 30, 2023

Looks like the script trow the error message and continue without ending prematurely, but since the G_AGUP -f isn't running it takes very litle time for the script to finish and that trick me. Sorry, I also paste the wrong source.

It will be better if the source . /boot/dietpi/func/dietpi-globals is declared in the begining of the script since G_AGUP is used also in row [[ $APT_UPDATE_MODE == 2 && -f '/run/dietpi/.update_available' ]] && G_AGUP -f earlier in the script.

I'm pleased to have been able to assist. Thank you for your dedication to the DietPi project.

@MichaIng
Copy link
Owner

MichaIng commented Sep 30, 2023

Keeping the load minimal: fa0646e
Now we have all globals function calls covered 😄. Would be cleaner to do all of this properly within dietpi-update I guess, having all kind of system updates in one script, also as part of the interactive menu.

Also, as we are working on an own APT server, we'll likely move parts and finally DietPi completely into the APT repository as packages, So that dietpi-update will loose its current major purpose. Only for APT key/source/config updates, which are currently done in "pre-patches", an additional script is still required. So until we know a bit clearer where the journey is going to, I will keep changes to dietpi-update minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

2 participants