in a systemd system where shall we put new service definitions? /usr/lib/systemd/system/…
- User
in a systemd system where shall we put new service definitions? /usr/lib/systemd/system/ or /etc/systemd/system/
Assistant
For new service definitions that you create, you should put them in
/etc/systemd/system/.Here's why:
/etc/systemd/system/is for local/custom service files created by the system administrator/usr/lib/systemd/system/(or/lib/systemd/system/on some distributions) is for service files provided by installed packages
The
/etcdirectory takes precedence over/usr/lib, so if you need to override a package-provided service file, you can create a file with the same name in/etc/systemd/system/and it will be used instead.Additionally, files in
/usr/lib/systemd/system/may be overwritten when packages are updated, while files in are preserved during system updates.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.