• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to check if 'mysqld' is running?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to check if 'mysqld' is running?


  • Subject: Re: How to check if 'mysqld' is running?
  • From: email@hidden
  • Date: Fri, 07 Dec 2001 15:26:51 -0500

On Friday, December 7, 2001, at 01:19 PM, Charles Bennett wrote:

[munched]


(e.g. httpd, sendmail, mysqld..)?
Related to this question . What is a sock file? What is a pid file? Is there
a difference between pid and sock files?

A pid file is ususaly a plain old text file with the pid of the daemon
as the only text inside.

The very existance of the file (in /var/run/) should indicate that the daemon is running,
because the daemon is supposed to delete that file on the way "down" and create
it when the daemon starts.

Of course if the daemon dies the pid file might not be removed, so it's wise
to check the contents of the file against something like getpriority()
to see if it's really running..


Don't know about mysql, but sometimes file locking is used on a pid file.
That way, when the process unlocks the file _or_ dies then the lock
is freed. I think netscape's httpd does this. You have to check with some
flavor of Unix locking, but it might just be advisory locking. You can still
read the file, and check if the process controls it by fcntl (?). You'd
have to check the daemon documentation, though.


ch


References: 
 >Re: How to check if 'mysqld' is running? (From: Charles Bennett <email@hidden>)

  • Prev by Date: Re: talking to shell from cocoa/obj-c
  • Next by Date: Re: The sick power!
  • Previous by thread: Re: How to check if 'mysqld' is running?
  • Next by thread: How to handle non-character keyboard events?
  • Index(es):
    • Date
    • Thread