I opened up a question for this problem and did not get a thorough enough answer to solve the issue (most likely due to a lack of rigor in explaining my issues which is what
The solution is to put the self.pool = Pool(process=4)
as the last line of the daemonize
method. Otherwise the pool ends up getting lost somewhere (perhaps in the fork
s). Then the pool can be access inside the run
method which is overloaded by the application you wish to daemonize. However, the pool cannot be accessed in the stop method and to do so would lead to NoneType exceptions. I believe there is a more elegant solution but this works and it is all I have for now. If I want the stop
to fail when the pool is still in action, I will have to add additional functionality to run
and some form of message but I am not currently concerned with this.