[UNIX]deamonize a process ?

J

Joona I Palaste

Franki said:
(running config : slackware with a 2.4.26 kernel )
I have a http server which run normally (a fork which accept connections) .

Your question is off-topic on comp.lang.c as it concerns OS-specific
extensions to C. Please ask in comp.unix.programmer.

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Parthenogenetic procreation in humans will result in the founding of a new
religion."
- John Nordberg
 
L

Lew Pitcher

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,

(running config : slackware with a 2.4.26 kernel )
I have a http server which run normally (a fork which accept connections) .
But I would like
to change the behaviour of my server (I would like to daemonize it ) :

Like the man said, this is off-topic for comp.lang.c

But, a hint: take a look at http://www.enderunix.org/docs/eng/daemon.php


- --

Lew Pitcher, IT Consultant, Enterprise Application Architecture
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFA2azDagVFX4UWr64RAut/AKCCvFDwrTfrm1l/Z/D3JxNI+p2RaQCg9eQL
nU5knO9VHoK8fZ+lcBAdVOQ=
=S5xG
-----END PGP SIGNATURE-----
 
F

Franki

Hello,

(running config : slackware with a 2.4.26 kernel )
I have a http server which run normally (a fork which accept connections) .
But I would like
to change the behaviour of my server (I would like to daemonize it ) :
- When I start it from the shell : #my_http_serv I would like to get
the same behaviour than apache.
example : #my_http_serv start
# <- here i come back
to the original shell.
How Can I do that please ?

Thanks.:)

p.s :I have written all the information ( pid , ...) into files ....
 
D

Dan Pop

In said:
(running config : slackware with a 2.4.26 kernel )
I have a http server which run normally (a fork which accept connections) .
But I would like
to change the behaviour of my server (I would like to daemonize it ) :
- When I start it from the shell : #my_http_serv I would like to get
the same behaviour than apache.
example : #my_http_serv start
# <- here i come back
to the original shell.
How Can I do that please ?

#my_http_serv start &
#

Dan ;-)
 
?

=?iso-8859-1?q?Nils_O=2E_Sel=E5sdal?=

Hello,

(running config : slackware with a 2.4.26 kernel )
I have a http server which run normally (a fork which accept connections) .
But I would like
to change the behaviour of my server (I would like to daemonize it ) :
- When I start it from the shell : #my_http_serv I would like to get
the same behaviour than apache.
example : #my_http_serv start
# <- here i come back
to the original shell.
How Can I do that please ?
read the man page for daemon(3) (no kidding)
Pass further *nix questions to comp.unix.programmer or
comp.os.linux.development.apps
 
D

Dan Pop

Please don't send me email copies of your replies to my posts!

In said:
But then when he logs out or closes his xterm, the server will stop.

It depends on your shell. If your shell is not able to properly put
a process in background, use the nohup command.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top