Permalink
Browse files

execl explained and fixme for upgrade filepaths

  • Loading branch information...
hypatia2 committed Oct 22, 2015
1 parent 3df6c3a commit 3ff3199782eb28976242d13c5bf82ac19212a2ce
Showing with 6 additions and 1 deletion.
  1. +3 −0 fruho/main.tcl
  2. +3 −1 fruhod/main.tcl
@@ -1961,6 +1961,7 @@ proc UpdateNowClicked {uframe} {
set files {fruho.bin.sig fruhod.bin.sig fruho.bin fruhod.bin}
# csp channel for collecting info about downloaded files
channel collector
#FIXME: files-exist should take full paths
if {![files-exist $files]} {
checkforupdates-status $uframe 16/downloading "Downloading..."
foreach f $files {
@@ -2788,6 +2789,8 @@ proc ffread-loop {} {
# restart only if different binaries
if {$sha ne $::model::Running_binary_fingerprint} {
model save
# execl replaces the calling process image with a new process image.
# This has the effect of running a new program with the process ID of the calling process.
execl [this-binary]
}
}
@@ -343,11 +343,13 @@ proc upgrade {dir} {
exec cp -f $newfruhod $fruhodpath
exec chmod u+rwx,go+rx $fruhodpath
# replace fruho.bin
# so fruho.bin is deployed here with root rights, but fruho client must restart itself
# so fruho.bin is deployed here with root rights, but fruho client must restart itself => add permissions to group and others
file rename -force $fpath $bf
file copy -force $newf $fpath
file attributes $fpath -permissions u+rwx,go+rx
# execl replaces the calling process image with a new process image.
# This has the effect of running a new program with the process ID of the calling process.
# if this does not fail it never returns
execl /usr/local/sbin/fruhod.bin
} on error {e1 e2} {

0 comments on commit 3ff3199

Please sign in to comment.