mptcpd icon indicating copy to clipboard operation
mptcpd copied to clipboard

mptcpize: use systemd overrides instead of editing vendor provided .service

Open candrews opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Currently, mptcpize will modify the vendor provided systemd service file located at /lib/systemd/system/*.service.

This approach is problematic because that file can and will change when new versions of the package that owns it are installed. The result is that the mptcpize modification to that file is unexpectedly lost.

Describe the solution you'd like systemd provides overrides as a solution to this problem. See https://www.freedesktop.org/software/systemd/man/systemd.unit.html

For example, I suggest that mptcpize enable xyz creates a file at /etc/systemd/system/apache2.service.d/mptcpize.conf with these contents:

[Service]
Environment="LD_PRELOAD=/usr/lib64/mptcpize/libmptcpwrap.so"

Furthermore, using the un-versioned library name (libmptcpwrap.so as opposed to libmptcpwrap.so.0.0.1) will avoid unexpected breakage when the version changes in the future.

candrews avatar Jan 31 '22 01:01 candrews

@pabeni FYI

ossama-othman avatar Jan 31 '22 18:01 ossama-othman

Good idea! I confirm it would be clearer and it would help in case of software update! :-)

matttbe avatar Aug 10 '22 16:08 matttbe