Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77798

Re: Example of python service running under systemd?

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 <airween@gmail.com>
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 Hegedüs <airween@gmail.com>
To Michael Torrie <torriem@gmail.com>
Subject Re: Example of python service running under systemd?
References <FE4C3550-8958-4F72-8AFE-62AA7248D6AF@gmail.com> <CAMw+j7+LQL_+77ejCFVSqWap7Rk9gS_Wu5d3y0gT1UpB8hiZAA@mail.gmail.com> <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13960.1410501914.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Example of python service running under systemd? Ervin Hegedüs <airween@gmail.com> - 2014-09-12 08:06 +0200

csiph-web