Marc Haber <mh+debian-ment...@zugschlus.de> writes: > I would like to deliver a YAML config file with the package and have the > old file still supported if an old file is still there (optimally > printing a warning when starting up with old format). I would prefer to > avoid a wrapper script. > > My idea would be to have two distinct systemd units, ser2net and > ser2net-oldconfig, with appropriate ConditionPathExists directives. > > Is there something more elegant?
Not sure it's better, but what about checking in the postinst if the old config file is present and if so installing a unit file snippet under /etc/systemd/system/ser2net.service.d overriding the ExecStart line for the old config file? (I wouldn't use /etc/default/ser2net at all.) And of course include a comment asking for its removal. -- Regards, Feri