Jobs Started from .profile getting killed

49 views Asked by At

Jobs which are triggered from OS Users .profile are getting killed after Putty Session is closed/exitted.

From the OS User "user1" jobs are triggered in application using sudo login to application id "app1".

  1. .profile of user1

    set -o vi
    mesg y
    export PS1='$LOGNAME-$PWD>'
    export APP_GRP=ALL
    ./app_menu
    exit
    
  2. in app_menu script app_menu is triggered from user1 which logs in to Application ID "app1"

    sudo -u app1 -i run_jobs.sh
    
  3. run_jobs.sh

    nohup jobname>/dev/null &
    pid=$!
    echo $pid
    wait $pid
    
  4. JobName submits a process in background and completes. This running jobs is the main application job. Now there is no issue till the putty session of the user1 is active. Once this session is closed/timed out the running process is killed automatically.

When the jobname is submitted directly to the app1 user from normal shell terminal using nohup sudo -u app1 -i jobname>/dev/null & , there is no issue.

Everytime the process is started using .profile , it is killed upon exiting the putty.

Have tried all the background options .

Please suggest solutions.

0

There are 0 answers