Groovix Net Control

From GroovixWiki
Revision as of 17:04, 12 August 2016 by GroovixAdmin (talk | contribs) (GNC Scripts)

Jump to: navigation, search

The Groovix system provides all networked workstations with unified profiles and software updates as part of the Groovix update process. This process is done through a system called Groovix NetCustomization or GNC. It queries updates, fixes and system changes from the Groovix Server and runs them automatically. If the system has not applied these updates, they are downloaded and installed automatically.

Normally, this process is performed on boot up, or can be customized to a specific update schedule; however, this process can be run manually at any time by typing /etc/init.d/groovix-netcustomization start in an xterm window. Every time Groovix NetCustomization is run, the results of that process are dumped into a log file that can be accessed for reference or troubleshooting located at /var/log/groovix/netcustomization.log, note that this only contains information from the last time GNC was run.


Setting up Groovix Server for GNC

Coming Soon


GNC Scripts

GNC updates are contained in their own directory in /var/www/groovix/gnc/updates/[customer] where [customer] is the name of your Groovix site (Groovix site information can found in the /etc/groovix/version file). Each GNC update has a file at the root of the directory called gnc; the gnc file is written in bash script as a series of commands listed in the order they should be run. Groovix provides parameters and commands that customize how and when GNC updates are run and which workstations will run them, these are described in more detail below.

The /var/www/groovix/gnc/updates/[customer] directory contains separate directories for the different types, sites, and labels for your deployment. GNC updates that only apply to a specific workstation type (ex. web, kiosk type) should be placed in the directory for that type (ex. /var/lib/groovix/updates/web/). Updates placed in the /var/www/groovix/gnc/updates/default directory are applied to all workstations.

Each workstation downloads and executes the script individually after downloading it from Open Sense servers or your local Groovix Server. GNC updates that have been downloaded and executed can be found locally on each workstation in the /var/lib/groovix/updates/master.bash file.

Script Structure

To have predictable results with the order in which GNC scripts are run, the GNC_ORDER= variable in the gnc file is used. The order can be a decimal and typically it is a representation of the date and time that you created or updated the gnc, ex. 20160215.162800 for February 15th at 4:28 pm.

When a Groovix workstation downloads multiple updates, it runs them in sequential order. 0-1000 should be reserved for GNC updates that are required to be run before other updates, 2000's should be used for most typical updates that require no specific order of importance, and 9000's should be reserved for GNC updates that need to be run last, or after other updates.

When you create a new gnc with the gnc-new command the GNC_ORDER= will automatically be set. When you edit a gnc and want the update to be re-applied to machines that have already run it succesfully, run gnc-bump [updatename] to update the GNC_ORDER= variable in the gnc.


Script Rules & Formatting

  • Each update must have a gnc file in the root of the update directory
  • Update directories are typically named for what they do and can contain letters, numbers, dashes, and underscores
  • Update directories named with 0000-1000 are run first
  • Update directories named by date (20110228) run after initial updates
  • Update directories named 9000+ are run after all other updates
  • If files are included in your update other than gnc, create the directory structure those files will reside in, i.e. mkdir -p [updatename]/etc/cups/printers.conf
  • The first line of the gnc batch script contains the parameters that dictate how the update will be ran


GNC Script Parameters

  • --abort - exits the script if an error occurs so it can be run again. Avoid the abort flag for conditional arguments (like If statements) or use set +e before the conditional and set -e after the conditional in your script.
  • attemptonce - as soon as it attempts to run the update, it will never run it again.
  • background - no longer in use.
  • depends - not available for use at this time. Will run the update when a prior update has been run successfully.
  • onlybuild - runs the script only when building the image
  • onlyinstall - runs the script only during the imaging process
  • onlylive - runs the script only when booting from a live cd
  • runonce - if the result of the script is successful, it never runs again
  • skipbuild - skips running the script when building the image
  • skipinstall - skips running the script during the imaging process
  • skiplive - skips running the script if booting from a live cd


GNC Script Commands

  • gncget [filename] - gets file and places it in that same location ,
    • use --mod 644 to set the file permissions or it will by 700
    • use --gunzip for big files, store it as .gz on the server but refer to it with the .gz in the gncget command, it will be automatically unzipped
    • use --tgz to get an entire directory at a time, use [dirname].tgz on the server and give the full path to the directory in the gncget command
  • groovix-auto-apt-get install - unattended package install with all defaults
  • groovix-auto-apt-get remove - unattended package uninstall
  • bashconfset
  • pyconfset

GNC Script Examples

Note: Groovix Network Customization scripts all follow the structure, rules, and syntax documented in the Script Structure section above. Please familiarize yourself with this section before continuing on to the GNC script examples as the examples assume this knowledge is known beforehand.

GNC Examples


See Also