sysvinit scripts

This commit is contained in:
Smaine Kahlouch
2016-01-04 14:24:29 +01:00
parent 6103d673b7
commit d172457504
5 changed files with 262 additions and 40 deletions

View File

@@ -39,13 +39,6 @@ DAEMON_USER=root
#
do_start()
{
# Avoid a potential race at boot time when both monit and init.d start
# the same service
PIDS=$(pidof $DAEMON)
for PID in ${PIDS}; do
kill -9 $PID
done
# Return
# 0 if daemon has been started
# 1 if daemon was already running

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# /etc/rc.d/init.d/kubelet
#
@@ -22,22 +22,13 @@
. /etc/rc.d/init.d/functions
prog="kubelet"
exec="{{ bin_dir }}/$prog"
exec="/usr/local/bin/$prog"
pidfile="/var/run/$prog.pid"
lockfile="/var/lock/subsys/$prog"
logfile="/var/log/$prog"
[ -e /etc/kubernetes/$prog ] && . /etc/kubernetes/$prog
prestart() {
service cgconfig status > /dev/null
if [[ $? != 0 ]]; then
service cgconfig start
fi
}
start() {
if [ ! -x $exec ]; then
if [ ! -e $exec ]; then
@@ -51,11 +42,11 @@ start() {
check_for_cleanup
if ! [ -f $pidfile ]; then
prestart
printf "Starting $prog:\t"
echo "\n$(date)\n" >> $logfile
$exec $DAEMON_ARGS &>> $logfile &
pid=$!
echo $pid >> $pidfile
touch $lockfile
success
echo