File: //etc/init.d/azuremonitoragent
#!/bin/bash
#
# Init file for MDSD
#
# chkconfig: 2345 70 70
# description: Azure Monitor Agent daemon
#
### BEGIN INIT INFO
# Provides: azuremonitoragent
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Azure Monitor Agent daemon
### END INIT INFO
RETVAL=0
DESC="Azure Monitor Agent Daemon"
NAME=azuremonitoragent
MDSD_BIN=/opt/microsoft/azuremonitoragent/bin/mdsd
MDSD_OPTIONS="-d"
# Exit if the package is not installed
[ -x "$MDSD_BIN" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
start()
{
echo -n "Starting $DESC: "
$MDSD_BIN $MDSD_OPTIONS
RETVAL=$?
echo
}
case "$1" in
start)
start
;;
reload)
# Not implemented. Keep for compatibility to ensure "systemctl reload <service>" does not fail
;;
*)
echo $"Usage: $0 {start|reload}"
RETVAL=1
esac
exit $RETVAL