Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
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? –  Gilles Jul 31 '14 at 23:15

1 Answer 1

With screen you probably need a login shell.

bash --login -c "screen -dmS node /home/nodejs/bridge/bridge.js"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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