LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Relate service to a package..Centos Linux. (https://www.linuxquestions.org/questions/linux-newbie-8/relate-service-to-a-package-centos-linux-4175524203/)

vipinsqa 11-03-2014 09:50 AM

Relate service to a package..Centos Linux.
 
Hi,

I am using following command to get a list of services on Centos:-

service --status-all

Now, for the list of services installed, I want to know the corresponding package for the service on Centos i.e. if MySQL service is running, I want to know the package name for corresponding service?

Can this be achieved via shell script?

Please confirm if possible.

Thanks.

Habitual 11-03-2014 10:53 AM

https://www.linuxquestions.org/quest...ce-4175524086/

knudfl 11-03-2014 04:29 PM

@vipinsqa,

.. if you know a file name for the "service",
please use 'rpm -qf' to get the package name.

Example : "/etc/rc.d/init.d/mysqld" → →
→ $ rpm -qf /etc/rc.d/init.d/mysqld

-

vipinsqa 11-03-2014 08:50 PM

Hi,

Thanks for the revert. Actually, I am using "service --status-all" command to get the list of all services. Is there a way I can get the file name of service along with this command or any other way to get the list of services and the corresponding file names on Centos. Kindly confirm.

Regards.


All times are GMT -5. The time now is 04:21 PM.