Commit c8610155 authored by Jondy Zhao's avatar Jondy Zhao

Fix slapos-re6stnet service couldn't find 'ip' command:

  Move all the scripts to /usr/bin
parent a469c989
...@@ -102,9 +102,6 @@ done ...@@ -102,9 +102,6 @@ done
# Backup slap-runner.html # Backup slap-runner.html
cp /etc/slapos/scripts/slap-runner.html{,.orig} cp /etc/slapos/scripts/slap-runner.html{,.orig}
# Add right to scripts
chmod +x /usr/local/bin/*
echo Run post-install script successfully. echo Run post-install script successfully.
read -n 1 -t 60 -p "Press any key to exit..." read -n 1 -t 60 -p "Press any key to exit..."
exit 0 exit 0
......
...@@ -44,18 +44,20 @@ Source: "opt\images\manager.ico"; DestDir: "{app}\cygwin\etc\slapos\images"; ...@@ -44,18 +44,20 @@ Source: "opt\images\manager.ico"; DestDir: "{app}\cygwin\etc\slapos\images";
Source: "setup.exe"; DestDir: "{app}"; Source: "setup.exe"; DestDir: "{app}";
Source: "opt\git\slapos.package\windows\scripts\setup-cygwin.bat"; DestDir: "{app}"; Source: "opt\git\slapos.package\windows\scripts\setup-cygwin.bat"; DestDir: "{app}";
Source: "opt\git\slapos.package\windows\scripts\ip"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\ip"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\useradd"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\useradd"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\usermod"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\usermod"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\groupadd"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\groupadd"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\brctl"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\brctl"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\tunctl"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\tunctl"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cygwin\usr\local\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\openvpn\bin\*"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\openvpn\bin\devcon.exe"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\openvpn\bin\addtap.bat"; DestDir: "{app}\cygwin\bin";
Source: "opt\openvpn\bin\deltapall.bat"; DestDir: "{app}\cygwin\bin";
Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver"; Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "opt\git\slapos.package\windows\scripts\slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
......
...@@ -594,7 +594,7 @@ if (( $? )) ; then ...@@ -594,7 +594,7 @@ if (( $? )) ; then
echo "Starting $service_name service ..." echo "Starting $service_name service ..."
cygrunsrv --start $service_name || show_error_exit "Failed to start $service_name service." cygrunsrv --start $service_name || show_error_exit "Failed to start $service_name service."
service_state=$(cygrunsrv --query $service_name | sed -n -e 's/^Current State[ :]*//p') service_state=$(cygrunsrv --query $service_name | sed -n -e 's/^Current State[ :]*//p')
fi fi
[[ x$service_state == "xRunning" ]] || show_error_exit "Failed to start $service_name service." [[ x$service_state == "xRunning" ]] || show_error_exit "Failed to start $service_name service."
echo Cygwin $service_name service is running. echo Cygwin $service_name service is running.
echo "You can check log files in the /var/log/re6stnet/*.log" echo "You can check log files in the /var/log/re6stnet/*.log"
...@@ -607,7 +607,6 @@ fi ...@@ -607,7 +607,6 @@ fi
#------------------------------------------------- #-------------------------------------------------
# Create instance of Web Runner # Create instance of Web Runner
#------------------------------------------------- #-------------------------------------------------
slaprunner_title="SlapOS-Node-Runner-In-$computer_id" slaprunner_title="SlapOS-Node-Runner-In-$computer_id"
grep -q "window.location.href" $slapos_runner_file grep -q "window.location.href" $slapos_runner_file
if (( $? )) ; then if (( $? )) ; then
...@@ -631,14 +630,14 @@ if (( $? )) ; then ...@@ -631,14 +630,14 @@ if (( $? )) ; then
patch_file=/etc/slapos/patches/slapos-cookbook-inotifyx.patch patch_file=/etc/slapos/patches/slapos-cookbook-inotifyx.patch
while true ; do while true ; do
/opt/slapos/bin/slapos node software --verbose /opt/slapos/bin/slapos node software --verbose
# Apply patches to slapos.cookbook for inotifix # Apply patches to slapos.cookbook for inotifix
if [[ -f $patch_file ]] ; then if [[ -f $patch_file ]] ; then
for x in $(find /opt/slapgrid/ -name slapos.cookbook-*.egg) ; do for x in $(find /opt/slapgrid/ -name slapos.cookbook-*.egg) ; do
echo Apply patch $patch_file at $x echo Apply patch $patch_file at $x
cd $x cd $x
patch -f --dry-run -p1 < $patch_file > /dev/null && patch -p1 < $patch_file patch -f --dry-run -p1 < $patch_file > /dev/null && patch -p1 < $patch_file
done done
fi fi
/opt/slapos/bin/slapos node instance --verbose /opt/slapos/bin/slapos node instance --verbose
/opt/slapos/bin/slapos node report --verbose /opt/slapos/bin/slapos node report --verbose
/opt/slapos/bin/slapos request $client_config_file $slaprunner_title $slaprunner_cfg --node computer_guid=$computer_id && break /opt/slapos/bin/slapos request $client_config_file $slaprunner_title $slaprunner_cfg --node computer_guid=$computer_id && break
...@@ -728,7 +727,7 @@ regtool -q get "$slapos_run_key\\$slapos_run_entry" || \ ...@@ -728,7 +727,7 @@ regtool -q get "$slapos_run_key\\$slapos_run_entry" || \
"\"$(cygpath -w /usr/bin/bash)\" --login -i $slapos_run_script" || \ "\"$(cygpath -w /usr/bin/bash)\" --login -i $slapos_run_script" || \
show_error_exit "Failed to add slapos-configure.sh as windows startup item." show_error_exit "Failed to add slapos-configure.sh as windows startup item."
echo Startup item "$slapos_run_key\\$slapos_run_entry": $(regtool get "$slapos_run_key\\$slapos_run_entry") echo Startup item "$slapos_run_key\\$slapos_run_entry": $(regtool get "$slapos_run_key\\$slapos_run_entry")
echo echo
echo SlapOS Node configure successfully. echo SlapOS Node configure successfully.
read -n 1 -t 60 -p "Press any key to exit..." read -n 1 -t 60 -p "Press any key to exit..."
......
...@@ -38,18 +38,20 @@ Source: "opt\images\manager.ico"; DestDir: "{app}\cygwin\etc\slapos\images"; ...@@ -38,18 +38,20 @@ Source: "opt\images\manager.ico"; DestDir: "{app}\cygwin\etc\slapos\images";
Source: "setup.exe"; DestDir: "{app}"; Source: "setup.exe"; DestDir: "{app}";
Source: "opt\git\slapos.package\windows\scripts\setup-cygwin.bat"; DestDir: "{app}"; Source: "opt\git\slapos.package\windows\scripts\setup-cygwin.bat"; DestDir: "{app}";
Source: "opt\git\slapos.package\windows\scripts\ip"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\ip"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\useradd"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\useradd"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\usermod"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\usermod"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\groupadd"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\groupadd"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\brctl"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\brctl"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\tunctl"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\tunctl"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cygwin\usr\local\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\openvpn\bin\*"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\openvpn\bin\devcon.exe"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
Source: "opt\openvpn\bin\addtap.bat"; DestDir: "{app}\cygwin\bin";
Source: "opt\openvpn\bin\deltapall.bat"; DestDir: "{app}\cygwin\bin";
Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver"; Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "opt\git\slapos.package\windows\scripts\slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment