How to launch services and background processes?

  • There will be a need to install other required tools to be able to create an assignment. It can be anything. For example: Databases, Libraries and frameworks etc.
  • We provide a way to install and launch those services and background processes with a script.

How to enable init.sh script?

  • You can create init.sh script in the root folder of notebook as in the mySql database example shown below.
  • For any process or service that you want to run, make sure to install and run it with the script.

#!/bin/bash
sudo apt-get update
sudo apt-get install -y mysql-server
sudo systemctl start mysql
- This script will be executed when you launch the project. It will install MySql database.

Init.sh script

Note

You'll need to stop the course, save it, and restart it to let init.sh script take its effects.

Script permissions

  • To set the permissions, navigate to Terminal from the notebook by clicking New-> Terminal.
  • In the terminal enter the following:
    chmod 755 init.sh
    

Debug init.sh script execution

  • Each time we run the script, We create a log file in the home folder of notebook where your other files are stored.
  • It will start with init_logs_TIMESTAMP.log. You can print that file to see logs printed during execution.