1

I am using ubuntu 8.04.4 and would like to start daemons like this:

screen -dmS SESSIONNAME script.sh

Then i want to kill these screens with -X like so

screen -S SESSIONAME -X kill

But, this does not work. Only if i attach and detach that session it gets kill'ed with above command. What am i doing wrong? I would like to not have to attach/deattach the session to kill it since i want to use fabric scripts that start/stop daemons remotly.

- Thank you

2 Answers2

1

For daemons you really shouldn't be running them in screen.

In debian derived systems (such as Ubuntu) start-stop-daemon is the thing to use, RedHat and derivertives have a similar tool.

Read the man page, look at some init scripts for examples. on Ubuntu you may need to do a little delving as Upstart has mostly replaced standard init sctipts.

LapTop006
  • 6,496
  • 20
  • 26
  • Yes you are right. These daemons are just for my development and the thing i want to use screen for is that i want to be able to start/stop them from my local system. thank you –  May 01 '10 at 20:00
1

Try this:

screen -S SESSIONAME -X quit
Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151