]>
git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/server.c
2 * "$Id: server.c,v 1.2 2001/03/28 16:55:56 mike Exp $"
4 * Server start/stop routines for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-2001 by Easy Software Products, all rights reserved.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636-3111 USA
20 * Voice: (301) 373-9603
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
26 * StartServer() - Start the server.
27 * StopServer() - Stop the server.
31 * Include necessary headers...
39 # include <openssl/ssl.h>
40 # include <openssl/rand.h>
41 #endif /* HAVE_LIBSSL */
45 * 'StartServer()' - Start the server.
52 int i
; /* Looping var */
53 struct timeval curtime
; /* Current time in microseconds */
54 unsigned char data
[1024]; /* Seed data */
55 #endif /* HAVE_LIBSSL */
60 * Initialize the encryption libraries...
64 SSL_load_error_strings();
67 * Using the current time is a dubious random seed, but on some systems
68 * it is the best we can do (on others, this seed isn't even used...)
71 gettimeofday(&curtime
, NULL
);
72 srand(curtime
.tv_sec
+ curtime
.tv_usec
);
74 for (i
= 0; i
< sizeof(data
); i
++)
75 data
[i
] = rand(); /* Yes, this is a poor source of random data... */
77 RAND_seed(&data
, sizeof(data
));
78 #endif /* HAVE_LIBSSL */
81 * Startup all the networking stuff...
89 * If the administrator has configured the server to run as an unpriviledged
90 * user, change to that user now...
103 * 'StopServer()' - Stop the server.
110 * Close all network clients and stop all jobs...
127 * Close all log files...
130 if (AccessFile
!= NULL
)
137 if (ErrorFile
!= NULL
)
144 if (PageFile
!= NULL
)
152 * Clear the input and output sets...
161 * End of "$Id: server.c,v 1.2 2001/03/28 16:55:56 mike Exp $".