Muflix
Muflix

Reputation: 6798

linux how can i be sure what conf file service is using?

Hello im using Ubuntu and for example i installed nginx via apt-get and via passenger, now i have two nginx.conf location (/opt/nginx/conf/nginx.conf and /etc/nginx/nginx.conf) (but i removed first nginx installation with apt-get remove nginx) where i can ensure what configuration file (nginx.conf) /etc/init.d/nginx start will use ? It si more general linux question than nginx related.

Upvotes: 1

Views: 948

Answers (2)

piedar
piedar

Reputation: 2721

In Debian-based Linux, you can use dpkg to find the package to which a file belongs:

dpkg -S /etc/nginx/nginx.conf

Note that this will only work for files installed by dpkg (and therefore apt-get, Synaptic, USC, etc.). In this particular case, I'd wager that passenger installs into /opt, since an alternate package manager installing into /etc would be borderline evil.

Upvotes: 1

Summer_More_More_Tea
Summer_More_More_Tea

Reputation: 13416

One approach is to rename one of these configuration files and see whether the service can still start.

Upvotes: 1

Related Questions