10-16-2001
Click
here for some HP documentation on this subject.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How in the world do you create a daemon and get it to start with a startup script? could someone tell me in detail im going nuts...thanks (1 Reply)
Discussion started by: nmajin
1 Replies
2. Programming
Hello,
i am very very puzzled,
im doing this project for school, its a deamon logger, but anyways
I'm supposed to run the daemon, let it run on the backgroun, and then run a different program (from command like prompt). but when i run my daemon, it never goes back to the nova> prompt. :(
i dont... (3 Replies)
Discussion started by: Kacyndra
3 Replies
3. Shell Programming and Scripting
Hello, id like to know how can i do for making my script a daemon. Im not sure, but once , i might read about a "daemon" command. Thats true? Whats it for? It isnt in my man. (2 Replies)
Discussion started by: Jariya
2 Replies
4. Programming
how to convert a c program into a Daemon.
thanks in advance
svh (2 Replies)
Discussion started by: svh
2 Replies
5. AIX
Does anyone out there use rsync on AIX 5.2, I've installed and would like to run in server mode, I've setup in services and inetd.conf and refreshed inetd. The rsync daemon however does not start, I've also tried rsync --daemon, this just returns to the # prompt. The rsync command itself appears to... (1 Reply)
Discussion started by: gefa
1 Replies
6. Programming
Hi ,
I want to know how to write a daemon process. I also want to know the concept behind daemon processes. Any material or sample program will be great :) .
Thanks in advance
-sg (2 Replies)
Discussion started by: sg6876
2 Replies
7. Programming
i want to write a daemon service which listens the 8080 port and write down all the details in one file. How can i do this ? (2 Replies)
Discussion started by: santosh123
2 Replies
8. Programming
believe it or not but this is my first c program (i've worked with java, C#, php though) I am trying to make a daemon that checks if mplayer is running(it's for a projection room) and if it is not then to run mplayer with a file.. So far it's not working and I don't know why
Help and comments... (5 Replies)
Discussion started by: james2432
5 Replies
9. UNIX for Advanced & Expert Users
If my web browser does not support SSL.This means that I can't connect like this "https://xxxxx". My question is how can i make a stunnel4 daemon in client mode ? like when i connect to "http://localhost:3000" in the web browser i am navigating througth "https://www.randomweb.com". I need to know... (0 Replies)
Discussion started by: pepeleches
0 Replies
DAEMON(3) BSD Library Functions Manual DAEMON(3)
NAME
daemon -- run in the background
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
int
daemon(int nochdir, int noclose);
DESCRIPTION
The daemon() function is for programs wishing to detach themselves from the controlling terminal and run in the background as system daemons.
On Mac OS X, the use of this API is discouraged in favor of using launchd(8).
Unless the argument nochdir is non-zero, daemon() changes the current working directory to the root (/).
Unless the argument noclose is non-zero, daemon() will redirect standard input, standard output, and standard error to /dev/null.
RETURN VALUES
The daemon() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate
the error.
ERRORS
The daemon() function may fail and set errno for any of the errors specified for the library functions fork(2) and setsid(2).
SEE ALSO
fork(2), setsid(2), sigaction(2)
HISTORY
The daemon() function first appeared in 4.4BSD.
CAVEATS
Unless the noclose argument is non-zero, daemon() will close the first three file descriptors and redirect them to /dev/null. Normally,
these correspond to standard input, standard output, and standard error. However, if any of those file descriptors refer to something else,
they will still be closed, resulting in incorrect behavior of the calling program. This can happen if any of standard input, standard out-
put, or standard error have been closed before the program was run. Programs using daemon() should therefore either call daemon() before
opening any files or sockets, or verify that any file descriptors obtained have values greater than 2.
The daemon() function temporarily ignores SIGHUP while calling setsid(2) to prevent a parent session group leader's calls to fork(2) and then
_exit(2) from prematurely terminating the child process.
BSD
June 9, 1993 BSD