mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 09:38:12 -03:30
sysvinit scripts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user