How to control a background-process/daemon

Viewed 1013

I'm currently trying to create a program in C++ for Linux and I'm quite new to it.The program should do its stuff(Network communication and calculations) in the background and could be controlled with commands from the terminal, like "prog -start", "prog -stop", "prog -limitUp 1000".

My idea to realize that was to create the program as a daemon to always run in the background. To control the whole thing I thought to setup a linux command that takes the given arguments to the main function of my program and tries to reconnect to the daemon in the background to execute the given command then.

What is the best way to achieve such functionality (i.e. a daemon listening in the background and a client/command that can be used to control it).

1 Answers
Related