[wpkg-users] WPKG for remote / offline clients (who are never local)

Rainer Meier r.meier at wpkg.org
Mon Aug 4 16:14:58 CEST 2014


Hi Dave,

On 04.08.2014 15:53, Dave Evans wrote:
> Does anyone know of anything that will do what I'm after already?

I think there is nothing readily made yet. Though I would personally go for a 
very simple approach. On sites where multiple person work (like remote offices 
with very limited access) I would place a simple NAS system which does regular 
rsync synchronization from a central host. This would also reduce bandwidth as 
files are transferred only once to remote sites and then clients can install 
from local NAS.

Of course having remote standalone workplaces and updating them regularly is 
another topic as you also don't know about their connectivity.
I would perhaps even use the same approach here but rather than synching do a 
NAS I would run rsync process (perhaps robocopy might work too) to sync from 
central server to lokal workstation disk into dedicates software update folder. 
Also bandwidth limits etc. could be applied.

Rather than just launching WPKG (from local folder) a wrapper script might be 
generated which first invokes rsync to make sure the local folder is updated. 
After successful update (or if timeout occurs) WPKG might be run from local folder.

I think one thing to take care of is "atomic updates" so WPKG should not be run 
if package data has been transferred incompletely (e.g. connection lost during 
transfer). For this I do similar approach to sync to my memory stick where I 
have my WPKG update environment on-the-go. I first sync all software folders and 
in a second sync I do sync all the XML files. So if connection is interrupted 
before XML files are synced then WPKG will simply not perform any action. If 
interrupt takes place during XML sync then parts of the update might be applied. 
Consistency is usually not a problem as rsync transfers files atomically - so 
either the file is transferred or not, but not half-synced or broken.

So such an update-wrapper which syncs first and then runs WPKG if sync is 
successful or cancelled but does not invoke WPKG if rsync is interrupted should 
be possible to implement.


Of course this solution also comes with a disadvantage that rsync would copy all 
the files. So for example if your software storage folder contains large 
packages like Microsoft Office but Office is not deployed on this machine, then 
it would still sync/download it even tough not used. There is no way to prevent 
this since your sync process will not know about packages and required files at all.


There is a third option to be described here too. In fact you could use WPKG 
itself to download the software required. Older versions of WPKG supported the 
<download /> syntax in package XML files. In fact it's still supported but not 
recommended as it's limited. Instead WPKG comes with a tool called "downloader" 
(check tools folder on distribution ZIP). You can invoke it like any other 
command and based on it's exit code and even checksum verification WPKG can 
proceed or not. Check included documentation of downloader script.
Advantages is that WPKG itself (might be run from local drive) will initiate 
downloads (via HTTP/HTTPS) and it will only download the files you specify in 
packages. Disadvantage is that you would have to re-design the packages and 
basically provide a set of WPKG packages with download commands for remote 
clients and some package for internal clients which fetch directly from SMB 
share. Well, you could also use the download option for internal clients but I 
actually do not recommend this.


br,
Rainer



More information about the wpkg-users mailing list