How to override systemd unit file settings?

fdmillion

I have installed MySQL on my Arch Linux server. I moved the data directory to a place under /home, where my RAID volume is mounted. I noticed that mysqld will not start in this configuration by default since the systemd unit contains the setting ProtectHome=true.

I want to override just this setting. I don't want to re-specify the ExecStart or similar commands, in case they change when the package is upgraded.

I tried making a simple file at /etc/systemd/system called mysqld.service and added only these lines:

[Service]
ProtectHome=false

This doesn't work as it looks like the service in /etc replaces, not overrides, the system service.

Is there a way to override settings in systemd unit files this way without directly modifying the files in /usr/lib/systemd/system? (which is what I have done for now as a temporary fix, although that will end up reverted if the package is updated)

jdwolf

You may override a systemd unit file using

systemctl edit mysqld.service

Any statements made in the override file will take priority.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Systemd service unit file as user

分類Dev

Not sure what starts this systemd unit file

分類Dev

How to disable/override automatic mounting of tmpfs to /tmp by systemd?

分類Dev

How to override logging settings when running azure Functions locally?

分類Dev

How can I override settings in subprojects in an SBT project with multiple subprojects

分類Dev

systemd After [unit] option not working

分類Dev

How to see what command is being run by a systemd .timer file?

分類Dev

In systemd service file, how do I say "after USB is ready"?

分類Dev

Systemd .service file not working

分類Dev

In FitNesse is it possible to override settings configured in the root page?

分類Dev

How to match xml node of Settings file in C# application

分類Dev

How to match xml node of Settings file in C# application

分類Dev

How to reset the sshd_config file to its default settings

分類Dev

Move file and override

分類Dev

How to load a local json file in Xcode for unit test purposes?

分類Dev

How to create a PHP-Unit test for a file download?

分類Dev

Systemd service file with optional dependency

分類Dev

File location for unit testing

分類Dev

systemd: an service unit WITHOUT '[Install]' section, will it be auto run on boot?

分類Dev

Why can't systemd reload unit files automatically?

分類Dev

override config settings when using a fat jar for spark on EMR

分類Dev

Djangoでoverride_settingsを使用したSyntaxError

分類Dev

How to override a function in a package?

分類Dev

How to config top level build.gradle file of chatsecure to override other build.gradles?

分類Dev

How to use quote and dollarsign with systemd

分類Dev

How to run gunicorn as systemd daemon

分類Dev

How to use systemd special units

分類Dev

Bugzilla automated email settings file

分類Dev

Synaptic Package Manager File Settings

Related 関連記事

  1. 1

    Systemd service unit file as user

  2. 2

    Not sure what starts this systemd unit file

  3. 3

    How to disable/override automatic mounting of tmpfs to /tmp by systemd?

  4. 4

    How to override logging settings when running azure Functions locally?

  5. 5

    How can I override settings in subprojects in an SBT project with multiple subprojects

  6. 6

    systemd After [unit] option not working

  7. 7

    How to see what command is being run by a systemd .timer file?

  8. 8

    In systemd service file, how do I say "after USB is ready"?

  9. 9

    Systemd .service file not working

  10. 10

    In FitNesse is it possible to override settings configured in the root page?

  11. 11

    How to match xml node of Settings file in C# application

  12. 12

    How to match xml node of Settings file in C# application

  13. 13

    How to reset the sshd_config file to its default settings

  14. 14

    Move file and override

  15. 15

    How to load a local json file in Xcode for unit test purposes?

  16. 16

    How to create a PHP-Unit test for a file download?

  17. 17

    Systemd service file with optional dependency

  18. 18

    File location for unit testing

  19. 19

    systemd: an service unit WITHOUT '[Install]' section, will it be auto run on boot?

  20. 20

    Why can't systemd reload unit files automatically?

  21. 21

    override config settings when using a fat jar for spark on EMR

  22. 22

    Djangoでoverride_settingsを使用したSyntaxError

  23. 23

    How to override a function in a package?

  24. 24

    How to config top level build.gradle file of chatsecure to override other build.gradles?

  25. 25

    How to use quote and dollarsign with systemd

  26. 26

    How to run gunicorn as systemd daemon

  27. 27

    How to use systemd special units

  28. 28

    Bugzilla automated email settings file

  29. 29

    Synaptic Package Manager File Settings

ホットタグ

アーカイブ