My services all get enabled after sysupgrade. How can i preserve my service startup settings including disabled ones?
Yeah thanks i allready use a uci-defaults file which disables services at boot once. But i always have to adjust that file to the current situation.
I goal is to do a sysupgrade and it will take care of all of it. (The currenty disabled services)
I created a new automated solution:
- add /etc/uci-defaults/ to /etc/sysupgrade.conf
- before "sysupgrade" command execute this line:
for file in /etc/init.d/*; do $file enabled || echo $file disable; done > /etc/uci-defaults/01_disable_services
- after reboot the currently disabled services should be still disabled
edit: does anyone know why it needs a 2nd reboot for this to work?
You're not changing the sysupgrade image so the upgrade loads for the first time with services default enabled and then whatever you have in uci-defaults runs.
how can i fix this for the 1st boot?
I've always simply done my config in /etc/rc.local
so I'm not sure.
Hopefully someone who knows can chime in.
Handled by sysupgrade
since the commit bf304d10e97c ("base-files: sysupgrade: include uci-defaults script disabling services")
That commit is actually a rather big change, especially from old-timers' perspective, as the previous practice has been there for the last 15 years.
I hope that you can take care of adding suitable notes to wiki documentation etc. (especially if 23.05 and older remain with the previous practice, so that there will be differences between OpenWrt versions.)