D
D
DVoropaev2018-11-17 23:04:52
linux
DVoropaev, 2018-11-17 23:04:52

How to find out where is a service file in linux?

Let 's say I'm running Apache:
systemctl start apache2
how do I find out where the .service file with its service is located?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dymok, 2018-11-17
@DVoropaev

systemctl status apache2?

M
metajiji, 2018-11-18
@metajiji

It is better not to edit these files, but to make so-called overrides.

systemctl edit apache2
systemctl cat apache2

The systemctl edit apache2 command will create /etc/systemd/system/apache2.service.d/override.conf
and execute the systemctl daemon-reload itself.
The systemctl cat apache2 command will show which files apache2.service is built from. there may be other files in the /etc/systemd/system/apache2.service.d/ directory.
The advantages are that the distribution file will be updated and will not lose changes during updates.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question