Grafana Alloy service not starting automatically in Free BSD OS server

Hi Team,

Grafana Alloy service not starting automatically in Free BSD OS server.

Below is the script located in usr/local/etc/rc.d/alloy

**#!/bin/sh

PROVIDE: alloy

REQUIRE: DAEMON

KEYWORD: shutdown

#**
**
. /etc/rc.subr

Load Alloy environment variables

if [ -f /usr/local/etc/alloy/alloy.env ]; then

set -a

. /usr/local/etc/alloy/alloy.env

set +a

fi**
**
name=“alloy”

rcvar=“alloy_enable”**
**
start_cmd=“${name}_start”

stop_cmd=“${name}_stop”

status_cmd=“ps aux | grep ‘[a]lloy’ >/dev/null 2>&1”**
**
alloy_user=“root”

alloy_bin=“/usr/local/bin/alloy”

alloy_cfg=“/usr/local/etc/alloy/config.alloy”**
**
alloy_start() {

echo "Starting Alloy..."

${alloy_bin} run ${alloy_cfg} &

}**
**
alloy_stop() {

echo "Stopping Alloy..."

pkill -f "${alloy_bin} run ${alloy_cfg}"

}**
**
load_rc_config $name

: ${alloy_enable:=“NO”}**
**
run_rc_command “$1”

It is not starting the alloy service automatically after server restarts.**