Ticket #2 (closed defect: fixed)

Opened 2 years ago

Last modified 21 months ago

r2671 /sbin/update functionality

Reported by: reverged Owned by: isleman
Priority: major Milestone:
Component: dashboard Keywords:
Cc: Network name:

Description

The functionality of the update script has changed from r1523 to r2671 (perhaps at some intermediate revision) as it pertains to custom_update.

In the r2671 version, the node will not process the uci update if custom update is enabled. This is a change from r1523+.

Detail:

r1523 /sbin/update:


#!/bin/sh # RO.B.IN - 2007 by Antonio Anselmi <a.anselmi-at-oltrelinux-dot-com> # /sbin/update

. /etc/update-functionsA.sh . /etc/update-functionsB.sh

if [ "$node_role" -eq 0 ] ; then

if ! [ -e /tmp/current_gateway ] ; then

echo "gateway temporary loss, exit" exit 1

fi

fi

heartbeat echo "get node status..." ; get_node_status echo "check dashboard..." ; checkin_dashboard echo "pre-process reply..." ; pre_process_reply

# MD5 compute and reboot if necessary echo "compute md5..."

[ -e $MD5 ] echo "$(md5sum /etc/robin_version | head -c 32)" > $MD5 new_MD5="$(md5sum $rx_file_clean | head -c 32)" old_MD5="$(cat $MD5)"

if [ "${new_MD5}" = "${old_MD5}" ] ; then

logger -s -t "$ME" "nothing to update for this node"

check_node_drift [ "$(uci get management.enable.custom_update)" -eq 1 ] && custom_update exit 0

else

echo "$(md5sum $rx_file_clean | head -c 32)" > $MD5 blank_flags /etc/init.d/settings dashboard [ "$(uci get management.enable.custom_update)" -eq 1 ] && custom_update


In the above version, /etc/init.d/settings dashboard is executed even if custom_update is enabled.

r2671 /sbin/update:


#!/bin/sh # RO.B.IN - 2007 by Antonio Anselmi <a.anselmi-at-oltrelinux-dot-com> # /sbin/update

. /lib/robin/last-hop.sh . /etc/update-functionsA.sh . /etc/update-functionsB.sh

if [ "$node_role" -eq 0 ] ; then

[ -e /tmp/current_gateway ] getLastHop

fi

heartbeat

get_node_status checkin_dashboard [ "$(uci get management.enable.custom_update)" -eq 1 ] && custom_update

#reply handler

[ -s "$DASHBOARD_REPLY" ] exit [ -e "$OLD_REPLY" ] && {

diff $DASHBOARD_REPLY $OLD_REPLY && exit

}

pre_process_reply update_UCI [ "$(uci get management.enable.custom_update)" -eq 1 ] && custom_update


Notice that just after the dashboard checkin, custom_update is compared to 1 and if so, custom_update is called.

custom_update has the line:

exec /tmp/custom.sh

This will excute the custom_update but uci never gets updated.

Change History

Changed 2 years ago by marek

  • component changed from component1 to dashboard
  • milestone set to robin-1.5

Changed 2 years ago by isleman

  • owner changed from somebody to isleman

Changed 2 years ago by Antonio

  • status changed from new to closed
  • resolution set to fixed

should be fixed in r111 - thanks for reporting

Changed 21 months ago by anonymous

  • milestone robin-1.5 deleted

Milestone robin-1.5 deleted

Note: See TracTickets for help on using tickets.