Hi,
I want to make some mv commands only once after Attendant Sysupgrade ...
I tought of Idea to install useless package and disable it, and add startup command:
if /etc/init.d/<pkg> enabled; then
cd <path>
mv <old name> <new name>
/etc/init.d/<pkg> disable
/etc/init.d/<pkg> stop
fi
If your goal is to always stop/disable a specific package (i.e. you will never ever run it), there's no real harm in this script running post-firstboot.... it will evaluate the if statement (which will be false once the package is disabled the first time), and exit out.
You need to bake it into the next sysupgrade image as a custom file. Like you would need to do in any case, as extra files are not included in the sysupgrade backups.
(Not sure if you can do that with attendedsysupgrade, but you can do it with the normal Imagebuilder that you should use, if you want any extra files to be included)
@hnyman - If this was in a script and that was called by rc.local, wouldn't this work by nature as long as both rc.local and the other script were included in the standard backup files? Wouldn't this also work with ASU? I'm trying to figure out if I'm missing something (i.e. why it needs to be baked in vs part of the standard backup set).
I'm not real clear as to what you want to keep around across upgrades, but you can see what sysupgrade will retain with its --list-backup option:
$ sysupgrade -l
/etc/config/dhcp
... a bunch of files to keep ...
And you can extend that list by putting file or directory names in /etc/sysupgrade.conf. For example, I'll often do echo /root/test.sh >> /etc/sysupgrade.conf when I want to run a sysupgrade and keep some experiment around.