mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
elogd.pid is now created from child
SVN revision: 65
This commit is contained in:
parent
6c6bb6ae26
commit
eae8ab993f
41
elogd.c
41
elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.27 2002/06/03 08:07:47 midas
|
||||||
|
elogd.pid is now created from child
|
||||||
|
|
||||||
Revision 1.26 2002/06/03 07:32:27 midas
|
Revision 1.26 2002/06/03 07:32:27 midas
|
||||||
Added 'Title image URL' in theme file
|
Added 'Title image URL' in theme file
|
||||||
|
|
||||||
@ -7514,6 +7517,25 @@ struct timeval timeout;
|
|||||||
ss_daemon_init();
|
ss_daemon_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OS_UNIX
|
||||||
|
{
|
||||||
|
int pid;
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
|
/* crate /var/run/elogd.pid file */
|
||||||
|
pid = getpid();
|
||||||
|
f = fopen("/var/run/elogd.pid", "w");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
fprintf(f, "%d\n", pid);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signal(SIGTERM, ctrlc_handler);
|
||||||
|
signal(SIGINT, ctrlc_handler);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* listen for connection */
|
/* listen for connection */
|
||||||
status = listen(lsock, SOMAXCONN);
|
status = listen(lsock, SOMAXCONN);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
@ -8445,25 +8467,6 @@ usage:
|
|||||||
}
|
}
|
||||||
close(fh);
|
close(fh);
|
||||||
|
|
||||||
#ifdef OS_UNIX
|
|
||||||
{
|
|
||||||
int pid;
|
|
||||||
FILE *f;
|
|
||||||
|
|
||||||
/* crate /var/run/elogd.pid file */
|
|
||||||
pid = getpid();
|
|
||||||
f = fopen("/var/run/elogd.pid", "w");
|
|
||||||
if (f)
|
|
||||||
{
|
|
||||||
fprintf(f, "%d\n", pid);
|
|
||||||
fclose(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signal(SIGTERM, ctrlc_handler);
|
|
||||||
signal(SIGINT, ctrlc_handler);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
server_loop(tcp_port, daemon);
|
server_loop(tcp_port, daemon);
|
||||||
|
|
||||||
#ifdef OS_UNIX
|
#ifdef OS_UNIX
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user