<rmilecki>
i'd expect minidlna to stay disabled after sysupgrade
robimarko has quit [Remote host closed the connection]
robimarko has joined #openwrt-devel
<Ansuel>
rmilecki main problem of that is some may disable core service and brick the system on sysupgrade
<Ansuel>
saving them should not be hard tho... either a list of the services status or just bring the directory with the link in the restore package
<rmilecki>
Ansuel: if someone disables core service and reboots it's the same problem
<KanjiMonster>
sounds unlikely to have a working systems with disabled core systems that fails on sysupgrade if the same services are still disabled
<Ansuel>
well yes... implementing that might not be hard, should be enough to add some script in preinit after things are mounted and some logic to create a status file of the service when sysupgrade is called
<rmilecki>
i'll take a look at that
<jow>
I wouldn't backup the symlink tree
<jow>
might interfere when init script priorities etc. are changed
<Ansuel>
yep that is why i was thinking of saving the single service name instead of saving the links and putting them in the tar
<Ansuel>
a preinit script would then read the file (if found) and disable the related service on a just restored system
<KanjiMonster>
my first idea would be to iterate over the services on sysupgrade backup creation and store the is-enabled results, then reapply them on config restore
<Ansuel>
it's easier to handle the opposite case with the is-disabled
<Ansuel>
but yes that is my idea too
<KanjiMonster>
Ansuel: there is a "/etc/init.d/<service> enabled", that's what I meant
<Ansuel>
oh ok yes that would be the way to use (that under the hood just checks the link)
<KanjiMonster>
is-enabled is the systemd systemctl equivalent, obviously that won't work here ;)
<KanjiMonster>
this will obviously fail for services that were installed later and aren't in the base image, but those usually support an enabled uci option so it's fine
<dhewg>
I'd use such a feature. I have multiple devices of the same hw, where I build just one image, but require some services only on one
Borromini has joined #openwrt-devel
Borromini has quit [Quit: Lost terminal]
rua has joined #openwrt-devel
bluew has quit [Ping timeout: 480 seconds]
jeff___m has joined #openwrt-devel
jeff___m has quit [Ping timeout: 480 seconds]
jeff___m has joined #openwrt-devel
<jow>
in order to avoid introducing a new mechanism (and having to come up with a sensible file location for it), the simplest solution is probably creating a uci-defaults file on-the fly which contains various /etc/init.d/x enable lines.
<jow>
or disable ones
<jow>
if you introduce a new config file path within backup archives holding this information it becomes a public api and people might make assumptions about its format
<jow>
if it's in a persistent location, it clutters the rootfs
<jow>
if it's in an ephemeral location (such as /tmp or /var), it is somewhat "sneaky" and overlapping with uci-defaults functionality
<jow>
plus it might clobber the tmpfs mount point permissions on extraction if not handled with extra care
<jow>
in general, introducing a non-uci config file for defining service enablement state would not be ideal
jeff___m has quit [Ping timeout: 480 seconds]
<jow>
upside of the uci-defaults approach would also be the backwards compatibility to slightly older systems
<jow>
it would properly restore on systems not having any kind of new specialized "re-disable services on backup restore" logic
Borromini has joined #openwrt-devel
romany has joined #openwrt-devel
jeff___m has joined #openwrt-devel
<rmilecki>
/sbin/sysupgrade is crying for some refactoring & cleanup
jeff___m has quit [Ping timeout: 480 seconds]
jeff___m has joined #openwrt-devel
dangole has joined #openwrt-devel
jeff___m has quit [Ping timeout: 480 seconds]
<Piraty>
rmilecki: looks not too confusing on first glance
<Piraty>
start with shfmt / shellcheck , then go to logic level
<rmilecki>
i see that /sbin/sysupgrade mounts tmpfs dir to /etc/backup/ so that /etc/backup/installed_packages.txt gets created in tmpfs only
<rmilecki>
i'm wondering how to handle creating /etc/uci-defaults/10-disable-services (or whatever name we pick)