1.3. Update the PUN Utility

The PUN utility is maintained by the nginx_stage project. Assuming you previously installed it with Install the PUN Utility you can update it with the following directions.

1.3.1. Do I need to update?

Latest version: v0.3.0

You can compare this to the locally installed nginx_stage with the following command:

/opt/ood/nginx_stage/sbin/nginx_stage -v
#=> nginx_stage, version 0.3.0

where the version number should be given at the end of the line. If the version numbers match then you can skip this update.

1.3.2. Instructions to update

  1. Fetch the latest changes and check out the latest tag:

    cd ~/ood/src/nginx_stage
    scl enable git19 -- git fetch
    scl enable git19 -- git checkout v0.3.0
    
  2. Install it to its global location:

    sudo scl enable rh-ruby22 -- rake install
    # => mkdir -p /opt/ood/nginx_stage
    # => cp ...
    

    Danger

    Previous versions kept the nginx_stage YAML configuration file underneath the installation path:

    /opt/ood/nginx_stage/config/nginx_stage.yml
    

    This is not ideal, so for ALL future versions the YAML configuration will need to be moved to:

    /etc/ood/config/nginx_stage.yml
    

    If you have a custom configuration file you will NEED to move this:

    sudo mv /opt/ood/nginx_stage/config/nginx_stage.yml /etc/ood/config/nginx_stage.yml
    

    This is a one-time operation and will not need to be performed again after this.

  3. Clean up app configuration files that point to nonexistant apps:

    sudo /opt/ood/nginx_stage/sbin/nginx_stage app_clean
    
  4. Rebuild all the app configuration files in case the template has changed:

    sudo /opt/ood/nginx_stage/sbin/nginx_stage app_reset --sub-uri=/pun
    
  5. Shutdown all user PUNs that do not currently have active connections:

    sudo /opt/ood/nginx_stage/sbin/nginx_stage nginx_clean
    

    This is so that the user configuration files are regenerated when the user’s PUN starts back up. Any PUNs that do not get shutdown (they had an active connection) will eventually be shutdown when the user eventually disconnects due to the cron job.