I'm trying to auto-run a bunch of processes at system startup, after a user logs in. Here is the create_processes.py script that I will use to start some processes:
#!/usr/bin/python import subprocess def f1(): while True: time.sleep(2) print "I'm alive" if len(sys.argv) < 2: print "assuming main" subprocess.Popen([""/usr/bin/python",sys.argv,"f1"]) elif sys.argv =="f1": f1()
If I directly invoke it or if I try with
nohup python create_processes.py 2>&1 & everything works fine.
The problem rises when I try to make it run invoked by a script inside the /etc/profile.d/ folder. Such script simply contains the above command. Using
ps I can not find the children anymore. What happens in such context?
Thank you for your time and sorry for my poor English.