Reputation: 36287
I'd like to know how one would create an application that starts in the background. I'm currently creating a webserver in C as a little project, both to learn some old C and Linux Socket Programming. But my current concern is:
I want to get this because when I start the process, I want to display the process number for the user who starts the service.
Any references, tutorials and/or videos on how I'd do this is appreciated!
Maybe I was a little bit unclear; I want to get the Process ID from within C. So, do I need to create a shell script for my application or can I do this from C?
Upvotes: 2
Views: 1960
Reputation: 64404
getpid()
function.Upvotes: 5