title: How to run AWS SageMaker lifecycle config scripts as a background job
body: <p>I am trying to customize Amazon SageMaker Notebook Instances using Lifecycle Configurations because I need to install additional pip packages. What it means is I have to create a <code>on-start.sh</code> and <code>on-create.sh</code> script within a lifecycle configuration. You can see a sample <a href="https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/tree/master/scripts/export-to-pdf-enable" rel="nofollow noreferrer">here</a>.</p>
  <p><a href="https://i.stack.imgur.com/MUHT1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MUHT1.png" alt="enter image description here" /></a></p>
  <p>Now, I have many packages and the installation time might go over 5 minutes, causing a potential timeout. It is suggested to use <code>nohup</code> to run the script as a background job in that <a href="https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/blob/master/scripts/install-pip-package-all-environments/on-start.sh" rel="nofollow noreferrer">case</a>.</p>
  <p>But how do I run this with a <code>nohup</code> since I do not have a terminal in this case [see above screenshot]? Is there a way to run the script as a background job from within the script? Anything else I am missing? Please suggest</p>