Skip to content

Fixes for Install Script on Ubuntu 20.04

Merge Request Guidelines

  1. Please fill this form out to the best of your ability.
  2. Follow the principle of "One Merge Request, One Concern"
  3. Merge Requests must be complete in total.
  4. Contributed Code must be universal in scope, ie: Able to be used for all installs / install environments.

Description

I've made changes to osp-config.sh and app.py to add safety and consistency for new installs on Ubuntu 20.04 LTS.

Motivation and Context

I encountered several problems while trying to install osp:

  1. dpkg would lock up due to unattended-upgrades running in the background
  2. osp-rtmp log files had permissions issue that prevented the service from starting
  3. cachedDbCalls.getSystemSettings() was causing app.py to crash on fresh installs, which prevented the database from being created
  4. Ejabberd admin account creation was not always successful due to the install script not waiting for ejabberd to fully launch. I've also added an option on the installers main menu to recreate the admin account.
  5. If the full install was run multiple times, the mysql password would fail to reset but the password in config.py would be overwritten.
  6. Smtp settings were not being saved
  7. Resetting ejabberd prompted for the fqdn still, instead of defaulting to osp.internal.

I added the following functions to address the above:

  1. update_and_install_safely() will run apt-get update and unattended-upgrade --debug the first time it is called, and will wait until dpkg is available before attempting to apt-get install all packages sent as parameters
  2. confirm_service_is_running() will wait for the service sent as a parameter to be available before continuing in the install script. This is useful for services like ejabberd, that were failing to create the admin account as the command would be sent before the service was fully running.

cachedDbCalls.getSystemSettings() in app.py is now contained in a try/catch block that sends a message to the logs.

I've made changes to generate_ejabberd_admin() and reset_ejabberd() in the event that an older install hasn't generated the admin account properly.

How Has This Been Tested?

I tested all changes on a home server running Ubuntu 20.04 lts minimal install. Timeshift was used for rollbacks. Confirmed that I was able to stream to the device over lan and that vods were saved.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • Merge Request Follows the Merge Request Guidelines
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Merge request reports

Loading