[VOL-2426] : Write dev_mgmt_daemon logs into its own file instead of syslog

Change-Id: Id69d6a16d40a8ed8c3a83a5aceccf718ede4f7a2
diff --git a/agent/Makefile.in b/agent/Makefile.in
index 890fcc6..7d70bc5 100644
--- a/agent/Makefile.in
+++ b/agent/Makefile.in
@@ -316,11 +316,11 @@
 	@rm -f $(OBJS) $(DEPS)
 	@rm -rf $(OPENOLT_PROTOS_DIR)/googleapis
 	@rm -f $(BUILD_DIR)/libgrpc.so.6 $(BUILD_DIR)/libgrpc++.so.1
-	@rm -f $(BUILD_DIR)/libbal_api_dist.so
+	@rm -f $(BUILD_DIR)/libbal_host_api.so
 	@rm -f $(BUILD_DIR)/openolt
-	@rm -f $(BUILD_DIR)/bal_core_dist
-	@rm -f $(BUILD_DIR)/release_$(OPENOLTDEVICE)_V$(BAL_MAJOR_VER).$(DEV_VER).tar.gz
-	@rm -f $(BUILD_DIR)/openolt.deb
+	@rm -f $(BUILD_DIR)/dev_mgmt_daemon
+	@rm -f $(BUILD_DIR)/release_$(OPENOLTDEVICE)_V$(BAL_MAJOR_VER).$(BAL_MINOR_VER).$(BAL_REV_A_VER).$(DEV_VER).tar.gz
+	@rm -f $(BUILD_DIR)/openolt_$(OPENOLTDEVICE).deb
 
 clean-src: protos-clean
 	@rm -f $(OBJS) $(DEPS)
diff --git a/agent/device/asfvolt16/mkdebian/debian/logrotate.d/openolt b/agent/device/asfvolt16/mkdebian/debian/logrotate.d/openolt
index c224dbd..480b59f 100644
--- a/agent/device/asfvolt16/mkdebian/debian/logrotate.d/openolt
+++ b/agent/device/asfvolt16/mkdebian/debian/logrotate.d/openolt
@@ -1,4 +1,4 @@
-/var/log/bal_core_dist.log
+/var/log/dev_mgmt_daemon.log
 /var/log/openolt.log
 {
   rotate 7
diff --git a/agent/device/asgvolt64/mkdebian/debian/logrotate.d/openolt b/agent/device/asgvolt64/mkdebian/debian/logrotate.d/openolt
index c224dbd..480b59f 100644
--- a/agent/device/asgvolt64/mkdebian/debian/logrotate.d/openolt
+++ b/agent/device/asgvolt64/mkdebian/debian/logrotate.d/openolt
@@ -1,4 +1,4 @@
-/var/log/bal_core_dist.log
+/var/log/dev_mgmt_daemon.log
 /var/log/openolt.log
 {
   rotate 7
diff --git a/agent/scripts/init.d/dev_mgmt_daemon b/agent/scripts/init.d/dev_mgmt_daemon
index 9e5a5a3..5eba28c 100755
--- a/agent/scripts/init.d/dev_mgmt_daemon
+++ b/agent/scripts/init.d/dev_mgmt_daemon
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ### BEGIN INIT INFO
-# Provides:          bal_core_dist
+# Provides:          dev_mgmt_daemon
 # Required-Start:    $local_fs $network $syslog
 # Required-Stop:     $network $local_fs $syslog
 # Default-Start:     2 3 4 5
@@ -14,7 +14,7 @@
 PATH="/broadcom:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
 APPDIR="/broadcom"
 APPBIN="dev_mgmt_daemon"
-APPARGS="-pcie -syslog"
+APPARGS="-pcie -d"
 PID_FILE="root_dev_mgmt_pid"
 USER="root"
 GROUP="root"
@@ -27,8 +27,9 @@
   /opt/bcm68620/svk_init.sh
   sleep 10
   printf "Starting '$NAME'... "
+  touch /var/log/$NAME.log
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$APPDIR
-  start-stop-daemon --verbose --start --chuid "$USER:$GROUP" --background --no-close --chdir "$APPDIR" --exec "$APPBIN" -- $APPARGS 2>&1 || true
+  start-stop-daemon --verbose --start --chuid "$USER:$GROUP" --background --no-close --chdir "$APPDIR" --exec "$APPBIN" -- $APPARGS < /dev/tty1 >> /var/log/$NAME.log 2>&1 || true
   printf "done\n"
 }