I have a shell script that executes the following command:

bash -c "screen -dmS node /home/nodejs/bridge/bridge.js"

However, the screen is not being started. Typing the command...

screen -dmS node /home/nodejs/bridge/bridge.js

...in a terminal(logged as the same user that launches the script) the screen starts up properly.

  • What is the output when you're running your script ?
    – Ko2r
    Jul 31 '14 at 16:46
  • Have you tried using /usr/bin/screen instead of screen?
    – Wilf
    Jul 31 '14 at 17:08
  • Where do you execute the shell script from? From a terminal? If you're running the script from a session startup hook, which one? Why do you run bash -c "screen …" rather than screen … directly? Jul 31 '14 at 23:15

With screen you probably need a login shell.

bash --login -c "screen -dmS node /home/nodejs/bridge/bridge.js"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.