mmstick / cargo-deb

A cargo subcommand that generates Debian packages from information in Cargo.toml
615 stars 50 forks source link

Overwrite systemd unit files on upgrades? #185

Closed timbru closed 3 years ago

timbru commented 3 years ago

Hi,

I have a question really since it wasn't clear to me from reading the documentation.

Suppose that my package includes a systemd unit file, and a user makes local changes, will it then be overwritten again on upgrade or will the local file be left as-is?

I have a hunch that these files are treated as assets rather than conf-files and they are overwritten. I am not sure what the best practice would actually be in this case. Perhaps users are not expected to make local changes?

timbru commented 3 years ago

Right, so.. I think I figured it out so let me comment here and close this issue for now.

I believe that the unit file is an asset and that this is feature.

If users want to override the unit file settings they can do so by creating an override file. The easiest way to do this, that I found is by using systemctl edit.