Hello community,

here is the log from the commit of package google-startup-scripts for 
openSUSE:Factory checked in at 2015-03-19 21:15:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/google-startup-scripts (Old)
 and      /work/SRC/openSUSE:Factory/.google-startup-scripts.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "google-startup-scripts"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/google-startup-scripts/google-startup-scripts.changes
    2014-11-18 22:46:20.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.google-startup-scripts.new/google-startup-scripts.changes
       2015-03-19 21:15:13.000000000 +0100
@@ -1,0 +2,14 @@
+Wed Mar 11 11:40:26 UTC 2015 - [email protected]
+
+- Update to version 1.2.4 (bnc#921732)
+  + Check for a connection to the metadata server before startup
+    script retrieval.
+  + Block startup scripts until a connection to the metadata server exists.
+  + Added logging for network connectivity issues.
+  + Added retry logic in startup scripts for metadata requests.
+  + Improved performance on local SSD.
+  + Fix a bug which could cause instances to take 2 minutes to shut down.
+  + Miscellaneous documentation and diagnostic updates.
+  + Ensured that shutdown script feature will run before docker and kubelet.
+
+-------------------------------------------------------------------

Old:
----
  google-startup-scripts-1.1.9.tar.bz2

New:
----
  google-startup-scripts-1.2.4.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ google-startup-scripts.spec ++++++
--- /var/tmp/diff_new_pack.OuMQpx/_old  2015-03-19 21:15:14.000000000 +0100
+++ /var/tmp/diff_new_pack.OuMQpx/_new  2015-03-19 21:15:14.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package google-startup-scripts
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,12 +17,12 @@
 
 
 Name:         google-startup-scripts
-Version:      1.1.9
+Version:        1.2.4
 Release:      0
+Summary:        GCE start up tools
 License:      Apache-2.0
 Group:        System/Daemons
-Summary:      GCE start up tools
-URL:          https://github.com/GoogleCloudPlatform/compute-image-packages
+Url:            https://github.com/GoogleCloudPlatform/compute-image-packages
 Source0:      %{name}-%{version}.tar.bz2
 Source1:      google.suse
 Source2:      google-startup-scripts.suse
@@ -35,11 +35,10 @@
 Requires:     sysvinit
 %endif
 Requires:     rsyslog
-BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 BuildArch:    noarch
 
-
 %description
 Google Startup Scripts - Scripts and configuration files that setup a 
Linux-based image to work smoothly with GCE.
 
@@ -109,7 +108,6 @@
     %insserv_cleanup
 %endif
 
-
 %files
 %defattr(-,root,root,-)
 %doc LICENSE

++++++ google-startup-scripts-1.1.9.tar.bz2 -> 
google-startup-scripts-1.2.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-startup-scripts-1.1.9/etc/init/google_run_shutdown_scripts.conf 
new/google-startup-scripts-1.2.4/etc/init/google_run_shutdown_scripts.conf
--- old/google-startup-scripts-1.1.9/etc/init/google_run_shutdown_scripts.conf  
2014-11-08 01:18:19.000000000 +0100
+++ new/google-startup-scripts-1.2.4/etc/init/google_run_shutdown_scripts.conf  
2015-03-10 02:28:44.000000000 +0100
@@ -1,7 +1,7 @@
 # google - Run google shutdown script
 #
 #
-start on starting rc RUNLEVEL=[06] 
+start on starting rc RUNLEVEL=[06]
 task
 
 script
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-startup-scripts-1.1.9/etc/init.d/google-startup-scripts 
new/google-startup-scripts-1.2.4/etc/init.d/google-startup-scripts
--- old/google-startup-scripts-1.1.9/etc/init.d/google-startup-scripts  
2014-11-08 01:18:19.000000000 +0100
+++ new/google-startup-scripts-1.2.4/etc/init.d/google-startup-scripts  
2015-03-10 02:28:44.000000000 +0100
@@ -16,7 +16,7 @@
 ### BEGIN INIT INFO
 # Provides:    gce_run_startup_scripts
 # Required-Start:    $all
-# Required-Stop:     $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog docker kubelet
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: Google Compute Engine user scripts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-startup-scripts-1.1.9/usr/share/google/fetch_script 
new/google-startup-scripts-1.2.4/usr/share/google/fetch_script
--- old/google-startup-scripts-1.1.9/usr/share/google/fetch_script      
2014-11-08 01:18:19.000000000 +0100
+++ new/google-startup-scripts-1.2.4/usr/share/google/fetch_script      
2015-03-10 02:28:44.000000000 +0100
@@ -85,7 +85,7 @@
   # Unauthenticated download of the object.
   log "Downloading url from ${url} to ${dest} using curl"
   curl --max-time "${CURL_TIMEOUT}" --retry "${CURL_RETRY_LIMIT}" \
-    2> "${logfile}" -o "${dest}" -- "${url}" && return 0;
+    2>> "${logfile}" -o "${dest}" -- "${url}" && return 0;
 
   log "Failed to download $url"
   return 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-startup-scripts-1.1.9/usr/share/google/first-boot 
new/google-startup-scripts-1.2.4/usr/share/google/first-boot
--- old/google-startup-scripts-1.1.9/usr/share/google/first-boot        
2014-11-08 01:18:19.000000000 +0100
+++ new/google-startup-scripts-1.2.4/usr/share/google/first-boot        
2015-03-10 02:28:44.000000000 +0100
@@ -18,7 +18,6 @@
 declare -r INSTANCE_FILE=${PREFIX}/var/lib/google/vm-instance-id
 declare -r LOCK_FILE=${INSTANCE_FILE}.lock
 
-mkdir -p ${PREFIX}/var/lib/google/
 mkdir -p ${PREFIX}/var/lib/google/per-instance
 
 function log() {
@@ -30,8 +29,7 @@
 }
 
 function get_instance_id() {
-  # Do not retry to get the metadata value on failures.
-  MDS_TRIES=1 ${PREFIX}/usr/share/google/get_metadata_value id 2>/dev/null
+  ${PREFIX}/usr/share/google/get_metadata_value id 2>/dev/null
 }
 
 # Output the instance id.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-startup-scripts-1.1.9/usr/share/google/get_metadata_value 
new/google-startup-scripts-1.2.4/usr/share/google/get_metadata_value
--- old/google-startup-scripts-1.1.9/usr/share/google/get_metadata_value        
2014-11-08 01:18:19.000000000 +0100
+++ new/google-startup-scripts-1.2.4/usr/share/google/get_metadata_value        
2015-03-10 02:28:44.000000000 +0100
@@ -14,22 +14,17 @@
 # limitations under the License.
 
 # Get a metadata value from the metadata server.
-
 declare -r VARNAME=$1
-declare -r MDS_PREFIX=http://169.254.169.254/computeMetadata/v1
+declare -r MDS_PREFIX=http://metadata.google.internal/computeMetadata/v1
 declare -r MDS_TRIES=${MDS_TRIES:-100}
 
-function metadata_get_url_code() {
-  return $(curl "${1}" -H "Metadata-Flavor: Google" -s \
-      -w "%{http_code}" -o /dev/null)
-}
-
 function print_metadata_value() {
   local readonly tmpfile=$(mktemp)
-  curl -f "${1}" -H "Metadata-Flavor: Google" > ${tmpfile} 2>/dev/null
+  http_code=$(curl -f "${1}" -H "Metadata-Flavor: Google" -w "%{http_code}" \
+    -s -o ${tmpfile} 2>/dev/null)
   local readonly return_code=$?
   # If the command completed successfully, print the metadata value to stdout.
-  if [[ ${return_code} == 0 ]]; then
+  if [[ ${return_code} == 0 && ${http_code} == 200 ]]; then
     cat ${tmpfile}
   fi
   rm -f ${tmpfile}
@@ -39,13 +34,8 @@
 function print_metadata_value_if_exists() {
   local return_code=1
   local readonly url=$1
-  metadata_get_url_code ${url}
-  http_code=$?
-  # Test the instance metadata value.
-  if test ${http_code} -eq 200; then
-    print_metadata_value ${url}
-    return_code=$?
-  fi
+  print_metadata_value ${url}
+  return_code=$?
   return ${return_code}
 }
 
@@ -70,8 +60,8 @@
     case $return_code in
       # No error.  We're done.
       0) exit ${return_code};;
-      # Failed to connect to host.  Retry.
-      7) sleep 0.1; continue;;
+      # Failed to resolve host or connect to host.  Retry.
+      6|7) sleep 0.3; continue;;
       # A genuine error.  Exit.
       *) exit ${return_code};
     esac
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-startup-scripts-1.1.9/usr/share/google/onboot 
new/google-startup-scripts-1.2.4/usr/share/google/onboot
--- old/google-startup-scripts-1.1.9/usr/share/google/onboot    2014-11-08 
01:18:19.000000000 +0100
+++ new/google-startup-scripts-1.2.4/usr/share/google/onboot    2015-03-10 
02:28:44.000000000 +0100
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/bin/bash
 # Copyright 2013 Google Inc. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -41,6 +41,12 @@
   echo $* >> ${LOGFILE}
 }
 
+function set_interrupts() {
+  if [[ -x /usr/share/google/set-interrupts ]]; then
+    /usr/share/google/set-interrupts
+  fi
+}
+
 function virtionet_irq_affinity() {
   if [[ -x /usr/share/google/virtionet-irq-affinity ]]; then
     /usr/share/google/virtionet-irq-affinity
@@ -106,7 +112,44 @@
   return 0
 }
 
+function check_for_connection() {
+  local count=0
+  local return_code=0
+
+  log "Checking for metadata server connection."
+  while true; do
+    ((count++))
+    MDS_TRIES=1 /usr/share/google/get_metadata_value "?recursive=True"
+    return_code=$?
+    case ${return_code} in
+      # No error.  Connection is active.
+      0) break;;
+      # Failed to resolve host or connect to host.  Retry indefinitely.
+      6|7) sleep 1.0
+        log "Waiting for metadata server, attempt ${count}"
+        # After 7 minutes, add a console message denoting a probable network
+        # issue. On systems using dhclient there is an attempt to obtain an IP
+        # for 60 seconds followed by a 5 minute wait period. After 7 minutes,
+        # this cycle will have run through twice. After this period of time, it
+        # is not known when a DHCP lease might be obtained and the network
+        # interface fully operational.
+        if ((count >= 7*60+1)); then
+          log "There is likely a problem with the network."
+        fi
+        continue;;
+      # A genuine error but a connection exists.
+      *)
+        log "Check for connection non-fatal error getting metadata 
${return_code}"
+        break;;
+    esac
+  done
+  # Return the last return code we got.
+  return ${return_code}
+}
+
+set_interrupts
 virtionet_irq_affinity
+check_for_connection
 first_boot
 do_init
 print_ssh_key_fingerprints
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-startup-scripts-1.1.9/usr/share/google/run-shutdown-scripts 
new/google-startup-scripts-1.2.4/usr/share/google/run-shutdown-scripts
--- old/google-startup-scripts-1.1.9/usr/share/google/run-shutdown-scripts      
2014-11-08 01:18:19.000000000 +0100
+++ new/google-startup-scripts-1.2.4/usr/share/google/run-shutdown-scripts      
2015-03-10 02:28:44.000000000 +0100
@@ -21,9 +21,6 @@
 
 declare -r SHUTDOWN_SCRIPT=/var/run/google.shutdown.script
 
-# Make sure all udev changes settle before running shutdown scripts.
-udevadm settle
-
 # NOTE
 # Make sure that the shutdown script completes within 90 seconds, so
 # that the OS has time to complete its shutdown, including flushing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-startup-scripts-1.1.9/usr/share/google/set-hostname 
new/google-startup-scripts-1.2.4/usr/share/google/set-hostname
--- old/google-startup-scripts-1.1.9/usr/share/google/set-hostname      
2014-11-08 01:18:19.000000000 +0100
+++ new/google-startup-scripts-1.2.4/usr/share/google/set-hostname      
2015-03-10 02:28:44.000000000 +0100
@@ -1,4 +1,3 @@
-#! /bin/bash
 # Copyright 2013 Google Inc. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,7 +14,7 @@
 
 # Deal with a new hostname assignment.
 
-if [[ -n "$new_host_name" && -n "$new_ip_address" ]]; then
+if [ -n "$new_host_name" ] && [ -n "$new_ip_address" ]; then
   # Delete entries with new_host_name or new_ip_address in /etc/hosts.
   sed -i '/Added by Google/d' /etc/hosts
 
@@ -33,10 +32,9 @@
 # As a result, we set the host name in all circumstances here, to the truncated
 # unqualified domain name.
 
-if [[ -n "$new_host_name" ]]; then
+if [ -n "$new_host_name" ]; then
   hostname ${new_host_name%%.*}
 
   # Let syslogd know we've changed the hostname.
   pkill -HUP syslogd
 fi
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-startup-scripts-1.1.9/usr/share/google/set-interrupts 
new/google-startup-scripts-1.2.4/usr/share/google/set-interrupts
--- old/google-startup-scripts-1.1.9/usr/share/google/set-interrupts    
1970-01-01 01:00:00.000000000 +0100
+++ new/google-startup-scripts-1.2.4/usr/share/google/set-interrupts    
2015-03-10 02:28:44.000000000 +0100
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+total_cpus=`nproc`
+
+config_nvme()
+{
+  current_cpu=0
+  for dev in /sys/bus/pci/drivers/nvme/*
+  do
+    if [ ! -d $dev ]
+    then
+      continue
+    fi
+    for irq_info in $dev/msi_irqs/*
+    do
+      if [ ! -f $irq_info ]
+      then
+        continue
+      fi
+      current_cpu=$((current_cpu % total_cpus))
+      cpu_mask=`printf "%x" $((1<<current_cpu))`
+      irq=$(basename $irq_info)$a
+      echo Setting IRQ $irq smp_affinity to $cpu_mask
+      echo $cpu_mask > /proc/irq/$irq/smp_affinity
+      current_cpu=$((current_cpu+1))
+    done
+  done
+}
+
+config_scsi()
+{
+ irqs=()
+ for device in /sys/bus/virtio/drivers/virtio_scsi/virtio*
+ do
+   ssd=0
+   for target_path in $device/host*/target*/*
+   do
+     if [ ! -f $target_path/model ]
+     then
+       continue
+     fi
+     model=$(cat $target_path/model)
+     if [[ $model =~ .*EphemeralDisk.* ]]
+     then
+       ssd=1
+       for queue_path in $target_path/block/sd*/queue
+       do
+         echo noop > $queue_path/scheduler
+         echo 0 > $queue_path/add_random
+         echo 512 > $queue_path/nr_requests
+         echo 0 > $queue_path/rotational
+         echo 0 > $queue_path/rq_affinity
+         echo 1 > $queue_path/nomerges
+       done
+     fi
+   done
+   if [[ $ssd == 1 ]]
+   then
+     request_queue=$(basename $device)-request
+     irq=$(cat /proc/interrupts |grep $request_queue| awk '{print $1}'| sed 
's/://')
+     irqs+=($irq)
+   fi
+ done
+ irq_count=${#irqs[@]}
+ if [ $irq_count != 0 ]
+ then
+   stride=$((total_cpus / irq_count))
+   stride=$((stride < 1 ? 1 : stride))
+   current_cpu=0
+   for irq in "${irqs[@]}"
+   do
+     current_cpu=$(($current_cpu % $total_cpus))
+     cpu_mask=`printf "%x" $((1<<$current_cpu))`
+     echo Setting IRQ $irq smp_affinity to $cpu_mask
+     echo $cpu_mask > /proc/irq/$irq/smp_affinity
+     current_cpu=$((current_cpu+stride))
+   done
+ fi
+}
+
+config_nvme
+config_scsi

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to