Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a while loop in my Python Script and its independent script so I can't run it as a daemon.

Also I have tryed using nohup, but I'm having this error:

root@ubuntu:~/Desktop/starthere-group-ok# nohup python &
[1] 3038
root@ubuntu:~/Desktop/starthere-group-ok# nohup: ignoring input and appending output to `nohup.out'

The nohup.out:

1) Deployment
2) Service Status
3) List Servers
4) Restart Service
5) Restart Server
6) Execute Commands on Servers
Seçiminizi yapın: Traceback (most recent call last):
  File "", line 13, in <module>
    selection = raw_input("Seçiminizi yapın: ")
IOError: [Errno 9] Bad file descriptor

My script is kind of a job, I mean the Deployment part. It takes hours and hours sometimes and I can't leave the PuTTy open.

Seçiminizi yapın:
Means "Make your selection" in Turkish.

Maybe thats why I'm having this error? I'm using;

#!/usr/bin/env python
# -*- coding: utf-8 -*-

Metas at the beginning.

So, what should I do?

Thanks in advance.

share|improve this question
up vote 3 down vote accepted

You can use screen to keep your session alive

Or you could submit the job with "at"

share|improve this answer
Screen works fine, but i'm making this script for someone else and i dont think he can use it. Is there a code embedded way of doing it? with screen or not? Also "at" command is not for me. – nightrider84 Dec 12 '11 at 22:38
And I have found the way of doing it by screen. if selection: exe = Plugin.getAttribute('execute') system('screen python '+exe) Also benefits of using like this: Killing the screen after job completes. – nightrider84 Dec 12 '11 at 22:44

Your Answer


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.