[Kimchi-devel] CentOS Init Script
Daniel Henrique Barboza
dhbarboza82 at gmail.com
Tue Jul 14 17:58:32 UTC 2015
Hello,
This a script to start/stop/resume the kimchid daemon in CentOS 6,
right? Have you had the
chance to test it in Cent OS 7?
Thanks,
Daniel
ps: sorry for the delay in answering
On 07/02/2015 12:03 PM, Michael Sole wrote:
> I created a very simple CentOS 6 compatible init script. Its a little
> hacky but it does work. I know I am supposed to make a patch but perhaps
> someone can evaluate and decide if you want to include it:
>
> #!/bin/sh
> #
> # Name: Kimchi init script for CentOS 6
> # Author: Michael Sole
> # Email: michael.sole(at)soledevelopment.com
> #
> # Description: Very simple init script to start, stop and restart the
> Kimchi control panel
> #
> # Usage: /etc/init.d/kimchid start|stop|restart
>
> ### BEGIN INIT INFO
> # Provides: kimchid
> # Required-Start: $local_fs $syslog
> # Required-Stop: $local_fs $syslog
> # Default-Start: 2345
> # Default-Stop: 90
> # Short-Description: run kimchi daemon
> # Description: Very simple init script to start, stop and restart the
> Kimchi control panel
> ### END INIT INFO
>
> # Source function library.
> . /etc/rc.d/init.d/functions
>
> exec="/usr/bin/kimchid"
> prog="kimchid"
>
> lockfile=/var/lock/subsys/$prog
>
> start() {
> if [ -f "$lockfile" ]
> then
> echo "Lock file found, is the daemon already running?"
> exit 5
> fi
> echo -n $"Starting $prog: "
> nohup $exec > /dev/null 2>&1 &
> echo "OK"
> touch $lockfile
> return 0
> }
>
> stop() {
> echo -n $"Stopping $prog: "
> rm -f $lockfile
> ps aux | grep -ie $prog | awk '{print $2}' | xargs kill -9 > /dev/null
> 2>&1
> return 0
> }
>
> restart() {
> stop
> start
> }
>
> case "$1" in
> start)
> $1
> ;;
> stop)
> $1
> ;;
> restart)
> $1
> ;;
> *)
> echo $"Usage: $0 {start|stop|restart}"
> exit 2
> esac
> exit $?
>
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
More information about the Kimchi-devel
mailing list