On Sun, Nov 7, 2010 at 11:19 AM, Felix Schwarz <[email protected]> wrote: > Hi, > > I develop Python software and some of this software comes with a Python > daemon which is started during boot. Í can write a service file easily, just > starting the daemon as I do now with a traditional init script. > > If I understand the concept correctly, my daemon should use socket-based > activation for the most efficient usage of systemd. However I did not find > any reference how to do that in Python… > To me it looks like sd-daemon and friends are only available for > applications written in C. > > - Is that true? > - Is there any project to provide systemd glue code to Python?
You can do that in Python, basically you need to check some envvars to get the file descriptor number then use os.fdopen() to use those integers as python file objects... or use os.write()/os.read() that maps directly to C calls. I'm pretty sure there are similar things for sockets/sendmsg/readmsg. -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: [email protected] Skype: gsbarbieri Mobile: +55 (19) 9225-2202 _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
