Results 1 to 7 of 7
  1. #1
    Newbie
    Join Date
    Nov 2011
    Posts
    3

    Default Imaging a captured Untangle install via dd to many systems - problematic or safe?

    Hi,

    I'm trying to do wide-scale deployment of Untangle 9.X Lite without using CD-ROM drives for every system. I captured a disk image using DD, and plan on deploying it with a simple network-bootable clonezilla-like system. The hardware is the same for all the systems, but is there anything that would be troubling about the Untangle install being the exact same on each system? The individual systems will be shipped to different customers.

    Thanks for any tips/advice!

  2. #2
    Untangle Junkie dmorris's Avatar
    Join Date
    Nov 2006
    Location
    San Carlos, CA
    Posts
    17,486

    Default

    If the UID is the same for all systems it will cause issues.
    You'll need to either remove the UID and regenerate one or capture the disk image before the UID is generated.
    Attention: Support and help on the Untangle Forums is provided by volunteers and community members like yourself.
    If you need Untangle support please call or email support@untangle.com

  3. #3
    Newbie
    Join Date
    Nov 2011
    Posts
    3

    Default

    Thank you for the help dmorris! After some digging, I think I've figured it out..
    Can you please confirm that this is all I would need to do?
    Code:
    # (from an init script that deletes itself after running on first boot)
    rm /usr/share/untangle/conf/uid
    rm -fr /usr/share/untangle/gpg
    mkdir /usr/share/untangle/gpg
    chmod go= /usr/share/untangle/gpg
    export GNUPGHOME="/usr/share/untangle/gpg"
    gpg --list-keys # to regenerate them? I'm not familiar with gpg, seems to work
    sh /usr/share/untangle/bin/ut-createUID.sh
    Thanks in advance

  4. #4
    Untangle Junkie dmorris's Avatar
    Join Date
    Nov 2006
    Location
    San Carlos, CA
    Posts
    17,486

    Default

    looks good to me. Im not sure if the GPG stuff is needed, removing hte uid and running createUID.sh again might be sufficient.

    you may need to also remove /etc/apt/sources.list.d/untangle.list before running createUID.sh to make sure that is regenerated too
    Attention: Support and help on the Untangle Forums is provided by volunteers and community members like yourself.
    If you need Untangle support please call or email support@untangle.com

  5. #5
    Untangle Ninja sky-knight's Avatar
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Posts
    26,491

    Default

    Ages ago when we were testing stuff, we found that a box would always generate the same UID if you used this process. That's why we pull images before first boot.

    If this works now, it opens the door for us to modify the OS, apply patches, etc.

    Just pulled up a VM based on 9.1 Build 3.

    /usr/share/untangle/conf/uid doesn't exist until the first boot wizard completes
    /etc/apt/sources.list is still stock Debian

    After I complete the first boot wizard the uid file is created, and the sources.list is modified.

    rm /usr/share/untangle/conf/uid
    rm /etc/apt/sources.list

    sh /usr/share/untnagle/bin/ut-createUID.sh

    Both files are regenerated, both files indicate the same UID as before the files were destroyed.

    *another edit*

    Following the posted code, and replacing those gpg folders, it does indeed generate a new UID.

    May I ask where this script started? I've scoured the RC areas for ages and never located this elusive beast. It's been a bit of a grail around here for a few years now.
    Last edited by sky-knight; 11-25-2011 at 01:14 AM.
    Rob Sandling, BS:SWE, MCP
    NexgenAppliances.com
    Phone: 866-794-8879 x201
    Email: support@nexgenappliances.com

  6. #6
    Newbie
    Join Date
    Nov 2011
    Posts
    3

    Default

    Quote Originally Posted by sky-knight View Post
    May I ask where this script started? I've scoured the RC areas for ages and never located this elusive beast. It's been a bit of a grail around here for a few years now.
    I dunno, but you could probably pull the sources and search the commit logs/diffs? That was how I found the script - just got lucky the Untangle devs used an intuitive filename

    Here's the final solution I'm using. It lives in /etc/rcS.d/S60uid.sh and deletes itself after changing the UID once on first-boot. It's my first init script. Any suggestions/improvements highly welcomed! Also, no guarantees - it works for me on 9.0.2 though. Hope it helps somebody
    Code:
    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          uid
    # Required-Start:    urandom $local_fs
    # Required-Stop:
    # Should-Start:      glibc
    # Default-Start:     S
    # Default-Stop:
    # Short-Description: Set a new Untangle UID on boot
    ### END INIT INFO
    
    PATH=/sbin:/bin:/usr/bin
    
    . /lib/init/vars.sh
    . /lib/lsb/init-functions
    
    do_start () {
    	rm /usr/share/untangle/conf/uid
    	rm /etc/apt/sources.list.d/untangle.list
    	rm /usr/share/untangle/gpg/*
    	export GNUPGHOME="/usr/share/untangle/gpg"
    	gpg --list-keys
    	sh /usr/share/untangle/bin/ut-createUID
    	rm /etc/rcS.d/S60uid.sh
    	exit 0
    }
    
    case "$1" in
      start|"")
    	do_start
    	;;
      restart|reload|force-reload)
    	echo "Error: argument '$1' not supported" >&2
    	exit 3
    	;;
      stop)
    	# No-op
    	;;
      *)
    	echo "Usage: uid.sh [start|stop]" >&2
    	exit 3
    	;;
    esac

  7. #7
    Newbie
    Join Date
    Sep 2011
    Location
    Barcelona
    Posts
    9

    Default

    Hi,
    You also will need to re-assign the license voucher reedeming it from the untangle store web site.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO 3.6.0 PL2