Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.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.189 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.63; '*S*': 0.01; 'executable': 0.09; 'feature.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'michael,': 0.16; 'subject:under': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'cheers,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'michael': 0.29; 'thus': 0.29; 'layer': 0.31; 'sep': 0.31; 'file': 0.32; 'this.': 0.32; 'run': 0.32; 'running': 0.33; 'board': 0.35; 'no,': 0.35; 'received:google.com': 0.35; 'subject:service': 0.36; "didn't": 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'easily': 0.37; 'handle': 0.38; 'little': 0.38; 'url:01': 0.39; 'itself': 0.39; 'read': 0.60; 'from:charset:utf-8': 0.61; 'you.': 0.62; 'content- disposition:inline': 0.62; 'address': 0.63; 'hear': 0.63; 'skip:n 10': 0.64; 'networking': 0.64; 'url:blogspot': 0.65; 'to:addr:gmail.com': 0.65; 'services.': 0.70; 'url:2011': 0.75; 'forks': 0.84; 'it\xe2\x80\x99s': 0.84; 'received:86': 0.91; 'lot,': 0.93; 'received:hu': 0.93; 'service:': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=/dlFich95mAqzacDFZ2OdNBb3L+AZqCrZAioc5YuPlo=; b=Fj3DVaEHh9zfWRTwjcBmn8JoAHS3gDUibVmS7fYYf2UBs9Bd0vDsM/oXoQ5vRWBmxO c4ecg5nDigKcm/sM3Mi313DllrhiXG5N4uEN3Flx4b9THCcL5r1ll8iWWRYqDLaQT/yj UOEBuXw14YNXoEUAygPzGeNjajMNGm0HAY/3paeOViqraPLanPjNyEVDMVlmhjSZU1JL dlPOf1vEzby5HOgtrov7hQwQs8Hi+wQLliZjgZYRSryqoKO2QtIp0I+bfOSlNf6OrXQZ WlBlYUmjBsfmJBVzOC18fctnm7WL5RYi45XeeyfwizT9WTmYHzSyeSHEkRlm6f7IawKy mE1Q== X-Received: by 10.180.212.78 with SMTP id ni14mr8728301wic.44.1410501907858; Thu, 11 Sep 2014 23:05:07 -0700 (PDT) Date: Fri, 12 Sep 2014 08:06:51 +0200 From: Ervin =?utf-8?Q?Heged=C3=BCs?= To: Michael Torrie Subject: Re: Example of python service running under systemd? References: <6B97B7A5-0816-401E-9BDD-A23FFC646985@gmail.com> <20140911212921.GB26465@arxnet.hu> <5412548A.1090507@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5412548A.1090507@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: python-list@python.org 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1410501914 news.xs4all.nl 2880 [2001:888:2000:d::a6]:39108 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77798 Hi Michael, On Thu, Sep 11, 2014 at 08:03:54PM -0600, Michael Torrie wrote: > >> What I want is to have this startup, after my board has it’s networking layer up and running (and hopefully a valid ip address by then), and to just keep running forever > > > > may be you think about the fork(), eg: > > No, you you don't need to do this. Systemd can handle all of that for > you. Read up on the docs on creating systemd services. Here's a little > blog post that has some good examples, both a non-daemonizing service > and a daemonizing service: > > http://patrakov.blogspot.com/2011/01/writing-systemd-service-files.html > > Any executable file can be turned into a daemon service with systemd > (whether or not it forks itself into the background). Thus any python > script can easily be run from systemd. thanks a lot, I didn't hear about that feature. Cheers, Ervin