add sudo for sym run

This commit is contained in:
Yan
2018-01-23 15:14:07 +06:30
parent 773e1d2db0
commit 4248e53517
2 changed files with 10 additions and 10 deletions

View File

@@ -379,7 +379,7 @@ class License
# check_sym_proc_str = check_sym_proc_str.split("\n")
# sym_install_status = check_sym_proc_str[0].split(": ")
check_sym_proc_str = `#{"service SymmetricDS status"}`
check_sym_proc_str = `#{"sudo service SymmetricDS status"}`
# Check Sym Installed
# if sym_install_status[1] == "false"
@@ -390,15 +390,15 @@ class License
sym_run_status = check_sym_running(check_sym_proc_str, sym_path)
if sym_run_status
# Create Sym Table
check_sym_table = system(sym_path + "bin/symadmin --engine sx create-sym-tables")
check_sym_table = system("sudo " + sym_path + "bin/symadmin --engine sx create-sym-tables")
if check_sym_table
sym_sql = Rails.root + "db/sym_master.sql"
if File.exist? (sym_sql)
# Import Sym Sql to db and start sym
run_sym_sql = system(sym_path + "bin/dbimport --engine sx " + sym_sql.to_s)
stop_sym = system("service SymmetricDS stop")
run_sym = system("service SymmetricDS start")
run_sym_sql = system("sudo " + sym_path + "bin/dbimport --engine sx " + sym_sql.to_s)
stop_sym = system("sudo service SymmetricDS stop")
run_sym = system("sudo service SymmetricDS start")
if run_sym
response = { "status": true, "message": "Activation is success and Configuration done..."}
end