diff --git a/mbtk/libgsw_lib/gsw_sys_interface.c b/mbtk/libgsw_lib/gsw_sys_interface.c
index e674fd6..31b7603 100755
--- a/mbtk/libgsw_lib/gsw_sys_interface.c
+++ b/mbtk/libgsw_lib/gsw_sys_interface.c
@@ -5,16 +5,61 @@
 #include <pthread.h>
 #include <stddef.h>
 #include <dlfcn.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/time.h>
+
 #include "gsw_sys_interface.h"
 #include "gsw_log_interface.h"
 #define  LOG_LEVLE_CONFIG_FILE "/etc/telinit"
 
 #define GSW_SYS "[HAL][GSW_SYS]"
+
+#define SERVER_IP "127.0.0.1"
+#define TIMEOUT_SEC 3
+
+#define SSH_PORT 22
+#define FTP_PORT 21
+
+static int check_local_port(int port)
+{
+    int sockfd;
+    struct sockaddr_in server_addr;
+    struct timeval timeout;
+
+    if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
+        return 1;
+    }
+
+    timeout.tv_sec = TIMEOUT_SEC;
+    timeout.tv_usec = 0;
+    setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));
+    setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
+
+    memset(&server_addr, 0, sizeof(server_addr));
+    server_addr.sin_family = AF_INET;
+    server_addr.sin_port = htons(port);
+    inet_pton(AF_INET, SERVER_IP, &server_addr.sin_addr);
+
+    int ret = connect(sockfd, (struct sockaddr*)&server_addr, sizeof(server_addr));
+    close(sockfd);
+
+    return ret == 0 ? 0 : 1;
+}
+
 int gsw_sys_svr_ftp_start(const char *cfg)
 {
 	int ret = GSW_HAL_SUCCESS;
 	char command[128];
 
+	if(check_local_port(FTP_PORT) == 0)
+	{
+		
+		LOGI(GSW_SYS, "ftp service is running");
+		gsw_sys_svr_ftp_stop();
+	}
+
 	if(NULL == cfg)
 	{
 		strcpy(command, "/etc/init.d/vsftpd start");
@@ -34,29 +79,32 @@
 int gsw_sys_svr_ftp_stop()
 {
 	int ret = GSW_HAL_SUCCESS;
-	
-	ret = system("/etc/init.d/vsftpd stop");
-	if(ret != 0) 
+
+	if(check_local_port(FTP_PORT))
 	{
-		LOGE(GSW_SYS, "command /etc/init.d/vsftpd stop execution failed\n");
-		printf("FUNC:[%s] %d ret:%d\n", __FUNCTION__, __LINE__, ret);
-		ret = system("killall -TERM vsftpd");
-		if(ret != 0)
-		{
-			printf("FUNC:[%s] %d ret:%d\n", __FUNCTION__, __LINE__, ret);
-			LOGE(GSW_SYS, "command killall -TERM vsftpd execution failed\n");
-			goto exit;
-		}
+		LOGI(GSW_SYS, "ftp service is not running");
+		return GSW_HAL_SUCCESS;
 	}
 	
-exit:
-	return ret;
+	ret = system("/etc/init.d/vsftpd stop 2>/dev/null");
+	LOGI(GSW_SYS, "execute command etc/init.d/vsftpd stop 2>/dev/null  ret:%d", ret);
+		
+	ret = system("killall -TERM vsftpd 2>/dev/null");
+	LOGI(GSW_SYS, "execute command killall -TERM vsftpd 2>/dev/null  ret:%d", ret);
+		
+	return GSW_HAL_SUCCESS;
 }
 int gsw_sys_svr_ssh_start(const char *cfg)
 {
 	int ret= GSW_HAL_SUCCESS;
 	char command[128];
-		
+
+	if(check_local_port(SSH_PORT) == 0)
+	{
+		LOGI(GSW_SYS, "ssh service is running");
+		gsw_sys_svr_ssh_stop();
+	}
+	
 	if(NULL == cfg)
 	{			
 		strcpy(command, "/etc/init.d/sshd start");
@@ -79,23 +127,20 @@
 int gsw_sys_svr_ssh_stop()
 {
 	int ret = GSW_HAL_SUCCESS;
-	
-	ret = system("/etc/init.d/sshd stop");
-	if(ret != 0) 
+
+	if(check_local_port(SSH_PORT))
 	{
-		printf("FUNC:[%s] %d ret:%d\n", __FUNCTION__, __LINE__, ret);
-		LOGE(GSW_SYS, "command /etc/init.d/sshd stop sshd execution failed\n");
-		ret = system("killall sshd");
-		if(ret != 0)
-		{
-			printf("FUNC:[%s] %d ret:%d\n", __FUNCTION__, __LINE__, ret);
-			LOGE(GSW_SYS, "command killall sshd execution failed\n");
-			goto exit;
-		}
+		LOGI(GSW_SYS, "ssh service is not running");
+		return GSW_HAL_SUCCESS;
 	}
 	
-exit:
-	return ret;
+	ret = system("/etc/init.d/sshd stop 2>/dev/null");
+	LOGI(GSW_SYS, "execute command /etc/init.d/sshd stop 2>/dev/null  ret:%d", ret);
+	
+	ret = system("killall sshd 2>/dev/null");
+	LOGI(GSW_SYS, "execute command killall sshd 2>/dev/null  ret:%d", ret);
+	
+	return GSW_HAL_SUCCESS;
 }
 int gsw_sys_svr_syslog_restart(const char *log_lvl)
 {
@@ -105,6 +150,8 @@
 	int level = 0;
 	char *log_level_params[8] = {"emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"};
 	char *log_level_values[8] = {"1", "2", "3", "4", "5", "6", "7", "8"};
+
+
 	snprintf(command, sizeof(command), 
 			 "grep -q 'setprop sys.default.loglevel' %s", LOG_LEVLE_CONFIG_FILE);
 	for(level = 0; level < 8; level++)
