Daemon process is independent to control terminals and performs some tasks periodically or waits for processing certain events.The majority server realizes daemon process under Linux.This paper gives a method of programming daemon for Linux and offers a locking methods avoiding mutual disturbance of multiple copies of daemon itself.