heyo,

On Fri, Mar 11, 2005 at 12:17:15AM +0100, Christian Hammers wrote:
> > sure, but one question first.  would it be okay to assume the pidfile
> > is in /var/run/mysqld/mysqld.pid, or should we have to parse the
> > output of /usr/bin/mysqld --print-defaults for the pidfile?
> 
> Let's stay flexible, take something like this:
>  $ /usr/sbin/mysqld --print-defaults \
>      | tr " " "\n" \
>      | grep -- --pid-file \
>      | cut -d= -f2

well if we *really* want to be flexible, how about this:

## fetch a particular option from mysql's invocation
#
# usage: void mysqld_get_param option
mysqld_get_param() {
        /usr/sbin/mysqld --print-defaults \
                | tr " " "\n" \
                | grep -- "--$1" \
                | tail -1 \
                | cut -d= -f2
}

# ...

pidfile=`mysqld_get_param pid-file`

so, in the future, if we want to grab something else, it should be
pretty easy to do.

since it's a fairly small change, so i'll go ahead and commit it directly
to both trees.


        sean


-- 

Attachment: signature.asc
Description: Digital signature

Reply via email to