1

with python-deamon, it's possible to print pid of this deamon ? i want like this :

import daemon

context = daemon.DaemonContext()
with context():
    do_main_program()
print("pid of deamon : " + str(context.pid))

thanks for advance

ilapasle
  • 349
  • 4
  • 16
  • Is this related? https://stackoverflow.com/questions/17909754/python-daemon-no-pidfile – Erik Finnman Oct 17 '18 at 08:20
  • no, i want pid, no pidfile – ilapasle Oct 17 '18 at 09:01
  • What is the output of your print statement? what is the output of `print(dir(context))`? – Torxed Oct 17 '18 at 09:35
  • it's return list of argument : ['chroot_directory', 'close', 'detach_process', 'files_preserve', 'gid', 'initgroups', 'is_open', 'open', 'pidfile', 'prevent_core', 'signal_map', 'stderr', 'stdin', 'stdout', 'terminate', 'uid', 'umask', 'working_directory'] – ilapasle Oct 17 '18 at 11:15

0 Answers0