LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   last service restart (https://www.linuxquestions.org/questions/linux-newbie-8/last-service-restart-4175428779/)

fernfrancis 09-24-2012 08:26 AM

last service restart
 
hi guys

can someone tell me how to check when a service was last restarted

for example say httpd service


Thankx

acid_kewpie 09-24-2012 08:29 AM

just look at the age of the httpd process itself, or log entries specific to Apache. Generally there is no framework to track the service scripts themselves.

schneidz 09-24-2012 12:57 PM

Code:

[schneidz@hyper ~]$ sudo service sshd restart
Code:

[schneidz@hyper ide-34]$ sudo tail -f /var/log/messages
Sep 24 13:55:44 hyper systemd[1]: sshd.service: main process exited, code=exited, status=255
Sep 24 13:55:45 hyper systemd[1]: Unit sshd.service entered failed state.

...


edit: never mind... doesnt do anything with sudo service httpd restart

fernfrancis 09-25-2012 12:29 AM

Thanx a lot

I did a research and got found this which seems to be more precise

ps -p "processId" -o lstart

where processId is the id of the parent process in the case of httpd

try it out

Habitual 09-25-2012 01:26 PM

Quote:

Originally Posted by fernfrancis (Post 4788566)
Thanx a lot

I did a research and got found this which seems to be more precise

ps -p "processId" -o lstart

where processId is the id of the parent process in the case of httpd

try it out

I have always wanted to know how to find this out and now I know. It rocks and I am sticking it on my blog so I don't forget it. Ever.


All times are GMT -5. The time now is 07:58 AM.