Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'python': 0.09; '(say': 0.16; 'batteries': 0.16; 'for,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'gilles': 0.16; 'inputs': 0.16; 'outputs': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'config': 0.17; 'instance,': 0.17; 'platforms': 0.18; '(or': 0.18; 'app': 0.19; 'feb': 0.19; 'fairly': 0.21; 'regardless': 0.21; 'stopping': 0.22; 'title,': 0.22; 'runs': 0.22; 'apps': 0.23; 'split': 0.23; 'header :In-Reply-To:1': 0.25; 'core': 0.27; 'library.': 0.27; 'message- id:@mail.gmail.com': 0.27; 'run': 0.28; 'far,': 0.29; 'obscure': 0.29; 'probability': 0.29; 'included': 0.29; "i'm": 0.29; 'asking': 0.32; 'good.': 0.32; 'more,': 0.32; 'could': 0.32; 'controls': 0.33; 'to:addr:python-list': 0.33; 'front': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'explain': 0.36; 'but': 0.36; 'subject:" ': 0.36; 'two': 0.37; 'communicate': 0.37; 'received:209': 0.37; 'some': 0.38; 'to:addr:python.org': 0.39; 'hello,': 0.39; 'short': 0.39; 'end': 0.40; 'your': 0.60; "you'll": 0.62; 'agent': 0.64; 'within': 0.64; 'other.': 0.64; 'unnecessary': 0.65; 'hand': 0.82; '2013': 0.84; 'on?': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=R3bcTY1QD3R55hkIGwOM+HzyiQjU9XBvkrOVoHE4sBQ=; b=GXq0oS54QbxXrjJ3sOrVeAGF49jcjg7BLiuK0OPnGf+UE0FTbOmBWXMdJ/A4+Gw6Uo C1U/jIWu1TT6rAO1R0pXEGFdm2SIHdoKfN0eHPNvvdfX+SgBD6lhT8lJFOuPSaAMa0fd XeaSI0a45UVIe7v/yvHHyyL3x6cImC2Nd4RgwiTgcLV0fXlr4lM6G/3abvNL5Do/HPKS giu/oBKB1FdX7ia286viDLJeI4T/6vBfo3d1YPxf3qXVdWNpbXUHWeXzqbg0beuRhxfn HkiBfa0iSzNX+ARFD1f3FyOxSUxEptnZMd984rSsPX4Nn8+zPUvAeGCB1hd7M4RSljDk nYEA== MIME-Version: 1.0 X-Received: by 10.221.10.14 with SMTP id oy14mr692210vcb.34.1361963008623; Wed, 27 Feb 2013 03:03:28 -0800 (PST) In-Reply-To: <3e4921b7-fde3-4de7-ab01-1c98ddf63363@googlegroups.com> References: <3e4921b7-fde3-4de7-ab01-1c98ddf63363@googlegroups.com> Date: Wed, 27 Feb 2013 22:03:28 +1100 Subject: Re: "Daemonizing" an application. From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361963017 news.xs4all.nl 6985 [2001:888:2000:d::a6]:44701 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40050 On Wed, Feb 27, 2013 at 9:52 PM, Gilles Lenfant wrote: > Hello, > > Sorry for the obscure title, but I can't make short to explain what I'm searching for. :) > > I made an app (kind of proxy) that works without UI within it's process. So far, so good. > > Now I need to change "live" some controls of this application, without stopping it. > > So my app will be split in two : > > * A control app (say "appctl") for a console UI > * A daemon (or agent ?) that runs the core of the app (say "appd"), processing inputs and outputs Daemonizing is a fairly specific operation (forking and disconnecting from the console), which may well be a part of what you're asking for, but on the other hand may be unnecessary (if, for instance, you let your core app be invoked by Upstart directly). What form of control do you need? With many apps of this nature, the only control required is Unix signals - particularly SIGHUP, to say "I've edited your config files, go reread them". Your front end might do the editing, or you could even abolish the control app altogether and simply edit the configs manually. But if you need more, you'll need to work out how you want them to communicate with each other. What platform or platforms do you need this to run on? Regardless of your answers to the above, I would say that in all probability *yes*, you will be able to do this with just Python and the standard library. There are a lot of batteries included with Python :) ChrisA