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


Groups > comp.lang.python > #77790 > unrolled thread

Re: Example of python service running under systemd?

Started byMichael Torrie <torriem@gmail.com>
First post2014-09-11 20:03 -0600
Last post2014-09-11 20:03 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Example of python service running under systemd? Michael Torrie <torriem@gmail.com> - 2014-09-11 20:03 -0600

#77790 — Re: Example of python service running under systemd?

FromMichael Torrie <torriem@gmail.com>
Date2014-09-11 20:03 -0600
SubjectRe: Example of python service running under systemd?
Message-ID<mailman.13953.1410488545.18130.python-list@python.org>
On 09/11/2014 03:29 PM, Ervin Hegedüs wrote:
>> It basically creates two threads, one which does some local processing and control, the other which periodically does reporting via udp packets. I use the dual threads because they both work with a shared serial port at times, so I have to synchronize access through that.
>>
>> 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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web