Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.059 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'python': 0.07; 'instance.': 0.09; 'terminate': 0.09; 'scripts': 0.10; 'pm,': 0.11; 'wrote:': 0.14; 'starts': 0.15; 'command': 0.19; 'tue,': 0.20; 'header:In-Reply-To:1': 0.22; 'itself.': 0.22; 'manually': 0.22; 'runs': 0.24; 'script': 0.26; 'chris': 0.27; 'message- id:@mail.gmail.com': 0.28; 'looks': 0.28; 'server': 0.29; 'sends': 0.29; 'to:addr:python-list': 0.32; 'running': 0.36; 'received:209.85': 0.37; 'exactly': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'question,': 0.39; 'set': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'would': 0.40; 'header:Received:5': 0.40; '2011': 0.62; '26,': 0.68; 'here.': 0.68; 'daemon?': 0.84; 'have?': 0.84; 'received:209.85.210.174': 0.84; 'received:mail- iy0-f174.google.com': 0.84; 'restart': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=cOhpU8YhoI6XwCoSn+FOnXKyCUWuFJx9EPILr+mZGRw=; b=kHp3TMwCfblhY5mhIr3YfgeP3tnUWDj2sL+UAKCtVha5/HJGUZ3o4hF/TSn6R4mpCy iEbo9fmoKfqcWbPc1rj+bLdMm01E+W2/n41apZ6QY5/W8SfqgmSe0n4ijpm01HIfZL13 CXUlMVZQb9oWuaOOUYakkIpQrT364Ax3I/yRU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Cw0Wa0379hiSfixVrQhv+kHAFfUOHObNoKJkEM1yT/DGeE+rQVv6WEcfkPKKNXqwW+ 7lUfXM2tzOew/tvewRjD65GJVjfajJBNsgwz6NcMZOxeNOlCspuIPRmdXrr5bwsEt/nP yruxT8s1sVUchvLJv7+1d9aljEo2EGblDZt2A= MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 27 Apr 2011 05:38:48 +1000 Subject: Re: Restarting a daemon From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1303846732 news.xs4all.nl 32470 [::ffff:82.94.164.166]:33762 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4070 On Tue, Apr 26, 2011 at 10:13 PM, Jeffrey Barish wrote: > Not exactly a Python question, but I thought I would start here. > > I have a server that runs as a daemon. =A0I can restart the server manual= ly > with the command > > myserver restart > > This command starts a new myserver which first looks up the pid for the o= ne > that is running and sends it a terminate signal. =A0The new one then > daemonizes itself. What job manager do you have? Can you set up a script in /etc/init.d or /etc/init and then use that to restart the daemon? Upstart scripts can be managed with the 'initctl' command, for instance. Chris Angelico