473,408 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

[UNIX]deamonize a process ?

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 ....

Nov 14 '05 #1
7 3007
Franki <na****@oreka.com> scribbled the following:
Hello, (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 (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Parthenogenetic procreation in humans will result in the founding of a new
religion."
- John Nordberg
Nov 14 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Franki wrote:
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-----
Nov 14 '05 #3
In <40***********************@news.free.fr> "Franki" <na****@oreka.com> writes:
(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 ;-)
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #4
Dan Pop wrote:
In <40***********************@news.free.fr> "Franki" <na****@oreka.com> writes:

(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 ;-)


But then when he logs out or closes his xterm, the server will stop.
Nov 14 '05 #5
John Ilves wrote:
Dan Pop wrote:
In <40***********************@news.free.fr> "Franki" <na****@oreka.com>
writes:

(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 ;-)


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


nohup !!
--
Graham Lee
I am leeg, for we are many
Steve Jobs: "It's a pleasure to meet you, Professor Knuth. I've read all of
your books." Donald Knuth: "You're full of shit."
http://nextstep.sdf-eu.org/

Nov 14 '05 #6
On Wed, 23 Jun 2004 18:01:46 +0100, Franki wrote:
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

Nov 14 '05 #7
Please don't send me email copies of your replies to my posts!

In <40**************@adelphia.net> John Ilves <jo*******@adelphia.net> writes:
Dan Pop wrote:
In <40***********************@news.free.fr> "Franki" <na****@oreka.com> writes:

(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 ;-)


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
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Michael J. Moore | last post by:
Is it the listener process, or some other Oracle process. Also, on a UNIX system, when you do "ps -ef" to see your processes, the PPID points back to a process named "init". Why does the PPID not...
6
by: Joseph | last post by:
Hi, I am trying to develop a C# application that will run on Windows that will do the following * Select file name to process * FTP the file to a UNIX server * Process this file on UNIX using a...
2
by: anand.ba | last post by:
Hi all I need to find equivalent windows libraries for the following unix ones. #include <sys/prctl.h> #include <sys/ioctl.h> #include <unistd.h>
6
by: asimorio | last post by:
Hi folks, Recently, I am investigatin a memory leak issue. I have written a simple C++ program and a Perl script to test on UNIX environment machine. I do a for loop to new up 20 char of size...
8
by: mandydhaliwal | last post by:
Hi all, I am porting a win32 c++ program on Linux which first reads a list of processes and their paths from a file.Then this program should launch all of thesese processes. I tried to...
21
by: Tom Gur | last post by:
Hi, It's seems that csh and tcsh acts a bit different when handling special characters in quotes. i.e: if i'll supply my program with the following arguments: -winpath "c:\\temp\\" tcsh will...
3
by: mdshafi01 | last post by:
Hello my code is here. here i am unable to execute my perl programs . please help in this regards, #!/usr/bin/perl use warnings; use strict;
2
by: pisupati | last post by:
Hi, I need to a solution through perlscript. I have a unix process (ksh) running in a unix box. In the middle (of this process) there is a need to call a windows program and execute some steps...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.