Author: arkurth
Date: Mon Oct 19 17:49:10 2009
New Revision: 826733

URL: http://svn.apache.org/viewvc?rev=826733&view=rev
Log:
VCL-164
Updated cygwin-sshd-config.sh. Moved mount point section to beginning of script 
and set explicit paths to mount.exe and umount.exe. The script was failing to 
find mount after /usr/bin was unmounted.  This should allow the script to work 
if mount points are not configured prior to its execution. Also moved section 
that sets root as the owner of /home/root to earlier in the script.

Modified:
    incubator/vcl/trunk/managementnode/bin/cygwin-sshd-config.sh

Modified: incubator/vcl/trunk/managementnode/bin/cygwin-sshd-config.sh
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/bin/cygwin-sshd-config.sh?rev=826733&r1=826732&r2=826733&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/bin/cygwin-sshd-config.sh (original)
+++ incubator/vcl/trunk/managementnode/bin/cygwin-sshd-config.sh Mon Oct 19 
17:49:10 2009
@@ -102,6 +102,27 @@
 
 print_hr
 
+# Configure Cygwin mount points
+# ssh-host-config will fail if the mount points are configured as user instead 
of system
+echo Configuring mount points
+C:/cygwin/bin/umount.exe -u /usr/bin 2>/dev/null
+C:/cygwin/bin/mount.exe -f -s -b C:/cygwin/bin /usr/bin
+ls /usr/bin >/dev/null
+if [ $? -ne 0 ]; then die "failed to configure /usr/bin mount point"; fi;
+
+C:/cygwin/bin/umount.exe -u /usr/lib 2>/dev/null
+C:/cygwin/bin/mount.exe -f -s -b C:/cygwin/lib /usr/lib
+ls /usr/lib >/dev/null
+if [ $? -ne 0 ]; then die "failed to configure /usr/lib mount point"; fi;
+
+C:/cygwin/bin/umount.exe -u / 2>/dev/null
+C:/cygwin/bin/mount.exe -f -s -b C:/cygwin /
+ls / >/dev/null
+if [ $? -ne 0 ]; then die "failed to configure / mount point"; fi;
+
+mount
+print_hr
+
 # Stop and kill all sshd processes
 echo Stopping sshd service if it is running
 net stop sshd 2>/dev/null
@@ -170,20 +191,15 @@
 if [ $? -ne 0 ]; then die "failed to recreate /etc/passwd"; fi;
 print_hr
 
-# ssh-host-config will fail if the mount points are configured as user instead 
of system
-echo Configuring mount points
-umount -u /usr/bin 2>/dev/null
-mount -f -s -b C:/cygwin/bin /usr/bin
-umount -u /usr/lib 2>/dev/null
-mount -f -s -b C:/cygwin/lib /usr/lib
-umount -u / 2>/dev/null
-mount -f -s -b C:/cygwin /
-print_hr
-
 echo Adding execute permission on /var
 chmod -v +x /var
 print_hr
 
+# Make sure root owns everything in its home directory
+echo Setting root:None as the owner of /home/root
+chown -R root:None /home/root
+print_hr
+
 # Delete existing SSH settings and files in root's home directory
 echo Deleting /home/root/.ssh directory if it exists
 rm -rfv /home/root/.ssh
@@ -195,11 +211,6 @@
 if [ $? -ne 0 ]; then die "failed to run ssh-host-config"; fi;
 print_hr
 
-# Make sure root owns everything in its home directory
-echo Setting root:None as the owner of /home/root
-chown -R root:None /home/root
-print_hr
-
 # Run ssh-host-config, this is the main sshd service configuration utility
 echo Running ssh-host-config
 ssh-host-config -y -c ntsec -w "$PASSWORD"


Reply via email to