Skip to content
Advertisement

What is a drop-in file? What is a drop-in directory? How to edit systemd service [closed]

I want to change how a custom systemd service works.

systemctl edit serviceName

This edits /etc/systemd/system/serviceName.d/override.conf file. Override.conf is called a drop-in file and serviceName.d/ is a drop-in directory. I want to put a drop-in file definition and drop-in folder definition on the internet.

Advertisement

Answer

I would define: drop-in file – a file ending with .conf suffix, which is contained in a drop-in directory and the contents of which are concatenated to the (service) unit file with the same name as the drop-in directory.

Writing into override.conf for example After=memcached.service will add “memcached.service” to the list of elements in the After command in the unit file. If we want to override the After command, then we need to first reset the command withAfter= and then add our commands.

override.conf should be eg:

[UNIT] 
After= 
After=remote-fs.target sqldb.service memcached.service
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement