Ticket #2 (closed defect: fixed)
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 ]
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
Note: See TracTickets for help on using tickets.Download in other formats:
