in reply to logging of process
Take a look at IPC::Semaphore & KeyedMutex. I cannot help further as I don't run Linux.