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
# Backup slap-runner.html
cp /etc/slapos/scripts/slap-runner.html{,.orig}
# Add right to scripts
chmod +x /usr/local/bin/*
echo Run post-install script successfully.
read -n 1 -t 60 -p "Press any key to exit..."
exit 0
......
......@@ -44,18 +44,20 @@ Source: "opt\images\manager.ico"; DestDir: "{app}\cygwin\etc\slapos\images";
Source: "setup.exe"; 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\useradd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\usermod"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\groupadd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\brctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\tunctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\bin\*"; 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\bin"; Permissions: readexec;
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\bin"; Permissions: readexec;
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\bin"; Permissions: readexec;
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\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
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\git\slapos.package\windows\scripts\slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
......
......@@ -594,7 +594,7 @@ if (( $? )) ; then
echo "Starting $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')
fi
fi
[[ x$service_state == "xRunning" ]] || show_error_exit "Failed to start $service_name service."
echo Cygwin $service_name service is running.
echo "You can check log files in the /var/log/re6stnet/*.log"
......@@ -607,7 +607,6 @@ fi
#-------------------------------------------------
# Create instance of Web Runner
#-------------------------------------------------
slaprunner_title="SlapOS-Node-Runner-In-$computer_id"
grep -q "window.location.href" $slapos_runner_file
if (( $? )) ; then
......@@ -631,14 +630,14 @@ if (( $? )) ; then
patch_file=/etc/slapos/patches/slapos-cookbook-inotifyx.patch
while true ; do
/opt/slapos/bin/slapos node software --verbose
# Apply patches to slapos.cookbook for inotifix
if [[ -f $patch_file ]] ; then
# Apply patches to slapos.cookbook for inotifix
if [[ -f $patch_file ]] ; then
for x in $(find /opt/slapgrid/ -name slapos.cookbook-*.egg) ; do
echo Apply patch $patch_file at $x
cd $x
patch -f --dry-run -p1 < $patch_file > /dev/null && patch -p1 < $patch_file
done
fi
fi
/opt/slapos/bin/slapos node instance --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
......@@ -728,7 +727,7 @@ regtool -q get "$slapos_run_key\\$slapos_run_entry" || \
"\"$(cygpath -w /usr/bin/bash)\" --login -i $slapos_run_script" || \
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
echo
echo SlapOS Node configure successfully.
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";
Source: "setup.exe"; 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\useradd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\usermod"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\groupadd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\brctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\tunctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\bin\*"; 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\bin"; Permissions: readexec;
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\bin"; Permissions: readexec;
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\bin"; Permissions: readexec;
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\bin"; Permissions: readexec;
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\bin"; Permissions: readexec;
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\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