init.d file for mydumper

Asked by Pavel Stratil

Hi,

I ran into issues with the daemon mode when trying to write an init file for it. Is there a way to let mydumper create its pid file? Also is there a shutdown command for the daemon with the given pid?

Thanks, Pavel

Question information

Language:
English Edit question
Status:
Open
For:
MySQL Data Dumper Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andrew Hutchings (linuxjedi) said :
#1

Hi Pavel,

I apologise for the delay, I have been on vacation.

That is a great question, I have filed a bug report so that I can make this happen.

Revision history for this message
Pavel Stratil (pavel-senbonzakura) said :
#2

cool thanks :) I've packaged mydumper for Gentoo, so for now it will go into tree once reviewed without init scripts, once resolved here, I'll just write some ...

Revision history for this message
HighKing (esz-ei6h3l-n1h) said :
#3

I ran into the same issue. I have created a simple initscript (on a CentOS 6 machine) that does not check a pidfile so simply kills the process named "mydumper".

#!/bin/bash
#
# mydumper
#
# chkconfig: - 65 35
# description: Start the mydumper daemon
# processname: mydumper
#

# Source function library.
. /etc/rc.d/init.d/functions

name="mydumper"
user="backup"
cmd="/usr/bin/mydumper"
args="-D -c -o ~/mysql_exports"

start() {
  echo -n $"Starting $name: "
  daemon --user $user $cmd $args
  echo
}

stop() {
  echo -n $"Stopping $name: "
  killproc $name
  echo
}

case $1 in
  start)
    $1
  ;;
  stop)
    $1
  ;;
  restart)
  stop
  start
  ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
  ;;
esac

Can you help with this problem?

Provide an answer of your own, or ask Pavel Stratil for more information if necessary.

To post a message you must log in.