LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-24-2012, 08:26 AM   #1
fernfrancis
Member
 
Registered: Feb 2009
Location: Goa(India)-Sharjah(UAE)
Distribution: RHEL,centos,fedora,ubuntu
Posts: 224

Rep: Reputation: 18
last service restart


hi guys

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

for example say httpd service


Thankx
 
Old 09-24-2012, 08:29 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
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.
 
Old 09-24-2012, 12:57 PM   #3
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-19-live-usb/ aix
Posts: 3,840

Rep: Reputation: 590Reputation: 590Reputation: 590Reputation: 590Reputation: 590Reputation: 590
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

Last edited by schneidz; 09-24-2012 at 12:59 PM.
 
Old 09-25-2012, 12:29 AM   #4
fernfrancis
Member
 
Registered: Feb 2009
Location: Goa(India)-Sharjah(UAE)
Distribution: RHEL,centos,fedora,ubuntu
Posts: 224

Original Poster
Rep: Reputation: 18
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
 
1 members found this post helpful.
Old 09-25-2012, 01:26 PM   #5
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Slack14_64_Multilib
Posts: 3,072
Blog Entries: 4

Rep: Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741
Quote:
Originally Posted by fernfrancis View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron service and oracle service stopped unexpectedly. Can't restart oracle. camron Linux - Newbie 6 06-10-2010 06:00 PM
Restart Service malickhat Solaris / OpenSolaris 1 02-02-2010 03:02 PM
what is the difference between service network reload and service network restart ? markraem Linux - Networking 3 11-21-2007 03:08 PM
How do I set the regulatory daemon to restart when I restart the network service? zahadumy Linux - Networking 0 11-05-2006 11:24 AM
Can't SSH until restart service Da Puff Mandriva 4 09-14-2005 08:51 PM


All times are GMT -5. The time now is 03:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration