add priviledge to systemctrl
[vfc/nfvo/driver/vnfm/svnfm.git] / nokia / vnfmdriver / vfcadaptorservice / docker / instance-init.sh
index 3975b5a..93584e5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright 2017 Huawei Technologies Co., Ltd.
+# Copyright 2017, Nokia Corporation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 #
 # Config mysql credentials
 
-#sed -i "s|rootpass|rootpass|" webapps/ROOT/WEB-INF/classes/spring/Vnfmadapter/services.xml
+function start_mysql {
+    sudo docker run --privileged -i -t  -p 10080:80 centos /usr/sbin/init
+    sudo docker run --privileged  -ti -e "container=docker"  -v /sys/fs/cgroup:/sys/fs/cgroup  centos  /usr/sbin/init
+    
+    echo "start mysql in instance_init ... "
+    systemctl start mysql.service  > myout_instance_init.file 2>&1
+    cat myout_instance_init.file
+    systemctl status mysql.service > myout_instance_init_mysql_status.file 2>&1
+    cat myout_instance_init_mysql_status.file
+    sleep 5
+}
+
+start_mysql
 
 # Initialize MySQL schema
 cd bin