Skrevet av Emne: linux: Using screen in an init script  (Lest 4234 ganger)

ATC

  • Gjest
linux: Using screen in an init script
« på: 15. Mars 2009, 21:56 pm »
  • [applaud]0
  • [smite]0
  • What are the proper command line parameters for starting a program in a detached screen session?



    ATC

    • Gjest
    [Solved] linux: Using screen in an init script
    « Svar #1 på: 15. Mars 2009, 21:56 pm »
  • [applaud]0
  • [smite]0
  • cd /full/path
    screen -dmUS title ./program        

    Notice that when 'program' is terminated, the screen session will terminate as well. If you want to guarantee that the program keeps running even if it crashes, consider writing a looping wrapper such as this

    #!/bin/bash
    while echo; do ./program; done

    and run the wrapper in your screen session.