Ticket #934: 104

File 104, 3.0 KB (added by trac, 9 years ago)
Line 
1? cloud-adapter/dist_files/util/cloud/gef_fail.sh
2? cloud-adapter/dist_files/util/cloud/ec2/ami_scripts/sshd_config
3Index: cloud-adapter/dist_files/util/cloud/simhost/gef_shutdown_simhost.sh
4===================================================================
5RCS file: /cvs/hedeby-cloud-adapter/dist_files/util/cloud/simhost/gef_shutdown_simhost.sh,v
6retrieving revision 1.3
7diff -u -p -r1.3 gef_shutdown_simhost.sh
8--- cloud-adapter/dist_files/util/cloud/simhost/gef_shutdown_simhost.sh 20 Oct 2009 06:32:28 -0000      1.3
9+++ cloud-adapter/dist_files/util/cloud/simhost/gef_shutdown_simhost.sh 27 Nov 2009 13:28:08 -0000
10@@ -72,6 +72,7 @@ set_required SPOOL_DIR            "@@@sp
11 
12 # resource properties
13 set_required RES_resourceHostname "@@@RESOURCE:resourceHostname@@@"
14+set_required RES_simhostName      "@@@RESOURCE:simhostName@@@"
15 set_required RES_simhost          "@@@RESOURCE:simhost@@@"
16 
17 set_optional SIMHOSTS_FILE_NAME   "@@@simhosts_file_name@@@" "sdm_ec2.simhosts"
18@@ -92,20 +93,22 @@ sleep $SIMHOST_SLEEP_TIME
19 
20 # check if simhost is known
21 #    => remove host from SIMHOSTS_FILE
22-if is_simhost $RES_resourceHostname ; then
23+#    use exact name (RES_simhostName) that was used for storing the resource
24+if is_simhost $RES_simhostName ; then
25    tmp_file=$SIMHOSTS_FILE.new
26    # copy to preserve file permission
27    cp -p $SIMHOSTS_FILE $tmp_file
28-   sed "/^$RES_resourceHostname\$/d" $SIMHOSTS_FILE > $tmp_file
29+   sed "/^$RES_simhostName\$/d" $SIMHOSTS_FILE > $tmp_file
30    mv $tmp_file $SIMHOSTS_FILE
31 else
32-   fail_no_undo "Host '$RES_resourceHostname' is not in simhosts file '$SIMHOSTS_FILE'"
33+   fail_no_undo "Host '$RES_simhostName' is not in simhosts file '$SIMHOSTS_FILE'"
34 fi
35 
36 log "Shut down simhost '$RES_resourceHostname'"
37 
38 # reset resource properties
39 RES_resourceHostname=
40+RES_simhostName=
41 RES_simhost=
42 
43-write_output_parameters_and_exit RES_resourceHostname Res_simhost
44+write_output_parameters_and_exit RES_resourceHostname Res_simhost RES_simhostName
45Index: cloud-adapter/dist_files/util/cloud/simhost/gef_startup_simhost.sh
46===================================================================
47RCS file: /cvs/hedeby-cloud-adapter/dist_files/util/cloud/simhost/gef_startup_simhost.sh,v
48retrieving revision 1.2
49diff -u -p -r1.2 gef_startup_simhost.sh
50--- cloud-adapter/dist_files/util/cloud/simhost/gef_startup_simhost.sh  16 Oct 2009 08:34:40 -0000      1.2
51+++ cloud-adapter/dist_files/util/cloud/simhost/gef_startup_simhost.sh  27 Nov 2009 13:28:08 -0000
52@@ -106,6 +106,12 @@ fi
53 RES_resourceHostname="$res"
54 RES_simhost="true"
55 
56+# The string stored in RES_resourceHostname will be resolved by SDM (and thus
57+# might change from long to short hostname or vice versa). Therefore, store
58+# in a separate resource property exactly what string was saved in the simhost
59+# file, so that it can be found again when shutting down the host (issue XXX).
60+RES_simhostName="$res"
61+
62 log "Started up simhost '$RES_resourceHostname'"
63 
64-write_output_parameters_and_exit RES_resourceHostname RES_simhost
65+write_output_parameters_and_exit RES_resourceHostname RES_simhost RES_simhostName