1#!/usr/local/bin/bash 2# 3# Init file for AzureLinuxAgent. 4# 5# chkconfig: 2345 60 80 6# description: AzureLinuxAgent 7# 8 9# source function library 10. /etc/rc.d/init.d/functions 11 12RETVAL=0 13FriendlyName="AzureLinuxAgent" 14WAZD_BIN=/usr/local/sbin/waagent 15 16start() 17{ 18 echo -n $"Starting $FriendlyName: " 19 $WAZD_BIN -start 20 RETVAL=$? 21 echo 22 return $RETVAL 23} 24 25stop() 26{ 27 echo -n $"Stopping $FriendlyName: " 28 killproc -p /var/run/waagent.pid $WAZD_BIN 29 RETVAL=$? 30 echo 31 return $RETVAL 32} 33 34case "$1" in 35 start) 36 start 37 ;; 38 stop) 39 stop 40 ;; 41 restart) 42 stop 43 start 44 ;; 45 reload) 46 ;; 47 report) 48 ;; 49 status) 50 status $WAZD_BIN 51 RETVAL=$? 52 ;; 53 *) 54 echo $"Usage: $0 {start|stop|restart|status}" 55 RETVAL=1 56esac 57exit $RETVAL 58