systemd parses unit files once and keeps them in memory. Editing a file under /etc/systemd/system and running 'systemctl restart NAME' restarts the old definition. Recent versions print a warning that the unit file changed on disk, but scripts do not read warnings and older versions were silent.
Run 'systemctl daemon-reload' after any unit file change, then restart the service. In a provisioning script the reload must come between writing the file and starting the unit.
Prefer drop-ins to editing vendor units. 'systemctl edit NAME' creates /etc/systemd/system/NAME.service.d/override.conf and reloads for you; only the directives you list are changed, and a package upgrade cannot clobber them. Note that list-valued directives such as ExecStart and Environment accumulate rather than replace, so an override must first clear them with an empty assignment, as in a bare 'ExecStart=' line followed by the new one. Verify the merged result with 'systemctl cat NAME', which prints the vendor unit and every drop-in in application order, and 'systemctl show NAME' for the fully resolved property values.