jirutka / apk-autoupdate

Automatic updates for Alpine Linux and other systems using apk-tools
MIT License
53 stars 11 forks source link

programs_services doesn't seem to work #8

Open thiagowfx opened 2 years ago

thiagowfx commented 2 years ago

Disclaimer: I reproduced this only once.

Environment

% doas cat /etc/apk/autoupdate.conf
# Configuration for apk-autoupdate.

# List of packages that should not be automatically upgraded.
# Note: Case patterns (shell "case") may be used.
#packages_blacklist="linux-*"

# List of services that may be automatically restarted.
# Note: Case patterns (shell "case") may be used.
#services_whitelist=""

# List of services that should not be automatically restarted.
# Note: Case patterns (shell "case") may be used.
#services_blacklist="*"

# List of colon separated mappings between program path, the corresponding
# service and optionally action (e.g. restart, reload) to be performed.
# Example: /usr/sbin/nginx:nginx:reload.
# Note: Case patterns (shell "case") may be used in program path.
#programs_services=""
programs_services="/usr/bin/miniflux:miniflux:restart"

# List of fnmatch patterns specifying files to include/exclude from checking
# when scanning processes that use some files that have been upgraded.
#check_mapped_files_filter="!/dev/* !/home/* !/run/* !/tmp/* !/var/* *"

# Options to pass into OpenRC runscripts when restarting service.
#rc_service_opts='--ifstarted --quiet --nocolor --nodeps'
% doas crontab -l
# do daily/weekly/monthly maintenance
# min   hour    day     month   weekday command
*/15    *       *       *       *       run-parts /etc/periodic/15min
0       *       *       *       *       run-parts /etc/periodic/hourly
0       2       *       *       *       run-parts /etc/periodic/daily
0       3       *       *       6       run-parts /etc/periodic/weekly
0       5       1       *       *       run-parts /etc/periodic/monthly
0       0       *       *       *       apk-autoupdate

Expected

When miniflux updated from 2.0.34 to 2.0.35, it should have had automatically restarted the service.

Observed

Service wasn't restarted automatically. miniflux -version outputted 2.0.35, but my web instance was still running 2.0.34. A manual doas /etc/init.d/miniflux restart was necessary.

Happy to provide more logs if needed for troubleshooting, just let me know which ones.

thiagowfx commented 2 years ago

Actually, I wonder, do I need to explicitly set services_whitelist?

services_whitelist="miniflux"

If yes, then we could possibly improve the [docs](https://github.com/jirutka/apk-autoupdate/blob/7ec9519818a122fabc2f629a796f6ec7a35a17b1/man/autoupdate.conf.5.adoc#examples, as it contains an empty whitelist, suggesting it's not needed. If not, then the issue must be something else.

fossdd commented 3 weeks ago

I believe the issue here is that services_blacklist="*" is the unchanged default, so that services are not automatically restart without user's permission.

To update it in your case, you can either set services_whitelist to miniflux or *, or set services_blacklist=''.

I believe this is a miscommunication in the docs, I can look to update that.