put pid in file.
working on lockfile.