summaryrefslogtreecommitdiff
path: root/source3/printing/spoolssd.c
AgeCommit message (Collapse)AuthorFilesLines
2012-07-18loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell1-5/+7
They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-03-24lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij1-1/+1
The performance of these is minimal (these days) and they can return invalid results when used as part of applications that do not use sys_fork(). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-04change low FDs are handled in SambaAndrew Bartlett1-3/+0
We now only close fds 0, 1, 2 when we are a forked daemon, and take care not to close a file descriptor that we might need for foreground stdin monitoring. This should fix stdout logging in the lsa and epmapper deamons (ie in make test). Andrew Bartlett
2011-12-16s3:printing/spoolssd: avoid using server_messaging_context()Stefan Metzmacher1-1/+1
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Dec 16 16:29:41 CET 2011 on sn-devel-104
2011-12-15s3:printing/spoolssd: pass event and messaging context to check_updater_child()Stefan Metzmacher1-5/+4
metze
2011-12-12s3: Remove a bunch of calls to procid_self()Volker Lendecke1-2/+2
All callers to messaging_[re]init only used procid_self()
2011-09-05s3-smbd: Rename reload_printers() and add documentation.Andreas Schneider1-1/+1
Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Mon Sep 5 17:59:47 CEST 2011 on sn-devel-104
2011-09-05s3-spoolssd: Remove stale printers only on a valid pcap update.Andreas Schneider1-2/+2
load_printers() removes stale printers and we should only remove them if we have a CUPS connection and talked to cups. Else we will remove every configured printer if cups is not available. Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Mon Sep 5 11:18:23 CEST 2011 on sn-devel-104
2011-08-21s3-spoolss: Remove useless checkSimo Sorce1-24/+4
If we *really* are a bout to exit (PF_WORKER_EXITING) then the event will not be called as the loop will exit. Otherwise PF_SRV_MSG_EXIT may not be honoured for a long time if we have cients connected, therefore keep handling SIGHUP properly in those cases. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: Listen on parent messagesSimo Sorce1-0/+18
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: Send a message to the parent when we accept a connectionSimo Sorce1-0/+25
Every time we accept a connection wanr the parent, so it can run management routines and reallocate more resources if necessary. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: User new prefork helpers to simplify code.Simo Sorce1-27/+3
Also stop using the listening as now the prefork code properly sets the PF_WORKER_ACCEPTING flag and it can be relied upon without having to keep additional status around. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-prefork: Fix worker flags handling.Simo Sorce1-1/+1
We can't have a clear idea of wether the worker is IDLE or BUSY. The only things we can tell is if it is Alive, whether it is currently Accepting connections or wether it is Exiting soon. Remove PF_WORKER_IDLE, PF_WORKER_BUSY and replace their use with PF_WORKER_ALIVE. Also properly assign PF_WORKER_ACCEPTING so that users of the API can rely on the flag. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-prefork: do not use a lock_fd, just race on accept()Simo Sorce1-17/+3
We used a lock mimicking what apache does for preforked children. But it doesn't work properly in our case because we do not stop once a request has been served. Clients are allowed to perform multiple requests and keep the connection open. This means that if we allow multiple clients per children, then a child could take the lock and then be asked to do a long or even locking operation by a client it already is serving. This woulkd cause the whole server to deadlock, as the child is now busy and also holding on the lock. Using a race on accept() by having a tevent_fd on the listening socket wait for read events we never deadlock. At most we cause a bit of contention among children. But in the generic case connections are much less frequent for us as clients tend to be long lived. So the little contention we may have is not a big deal. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: Use prefrok utils to manage childrenSimo Sorce1-122/+26
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolss: Introduce helper function to manage pool.Simo Sorce1-52/+64
We were not properly managing allowed clients and pool management was duplicated across a few callers. Concentrate all management heuristics in one single function. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: Fix spoolss logging.Simo Sorce1-13/+11
Use the same code as in lsasd. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: Check if we were able to create the prefork pool.Andreas Schneider1-0/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-11s3-messaging: Do not register to classes we are not going to use.Simo Sorce1-1/+0
Signed-off-by: Andreas Schneider <asn@samba.org> Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Thu Aug 11 17:09:30 CEST 2011 on sn-devel-104
2011-08-11s3-messaging: Remove obsolete class.Simo Sorce1-2/+0
The FLAG_MSG_PRINT_NOTIFY class is actually obsolete and never used, as the only message belonging to it is not used either. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolss: Fix prototypes warnings.Andreas Schneider1-1/+4
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolss: do not call pcap_cache_reload() directlySimo Sorce1-5/+17
The background queue process is repsonsible for that. Just reload printers if necessary or wait for a message from bq to do that. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolss: Fix printers related messagingSimo Sorce1-4/+34
Children were not properly receiving messages to reload printers when the background queue process was dispatching them. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-prefork: Fix use of child id.Simo Sorce1-10/+9
Children Ids must start at 1 as 0 represent the father. Also fix callbacks that restart logs to use a procedd global variable that holds the Id so that they work correctly both fot the parent process and the children. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-printing: make sure to block SIGHUP ...Simo Sorce1-4/+20
... until we are ready to handle it. Also make us ready as early as possible in spoolssd. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolss: Use a global variable for the poolSimo Sorce1-60/+31
This allows for setting up signal handlers earlier which is needed for the following patch. It also simplify the code in a few places. After all we never have more than pool active at any time during spoolssd life span. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-printing: Allow bq process to have own logfileSimo Sorce1-23/+40
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolssd: Use the child_id to open log filesSimo Sorce1-15/+43
This way each child has its own log file and avoid mixing all logs form all children in the same parent log file. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-prefork: Pass the child a child_idSimo Sorce1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-prefork: Return tsocket_address for client and serverSimo Sorce1-7/+5
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-prefork: Pass messaging context around tooSimo Sorce1-15/+42
Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-prefork: Set up a SIGCHLD handler by defaultSimo Sorce1-39/+14
We need to properly handle preforked children so it is better to just do that automatically. If the parent needs/wants to intercept SIGCHLD events it can set a callback that will be called by the prefork code once the internal cleanup function that checks all prefork children has been executed. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3:spoolssd Start spoolssd from printing_subsystem_initSimo Sorce1-17/+48
Use a child for the background updater process Forward printer update messages from spoolss to background update process. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-printing: Rework how the background process is startedSimo Sorce1-0/+4
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-prefork: Provide a cleanup functionSimo Sorce1-11/+4
This way the parent doesn't need to know how to handle dead children and keeps all of that within the prefork abstraction. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-prefork: add support for multiple listning file descriptorsSimo Sorce1-5/+11
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolssd: propagate SIGHUP to childrenSimo Sorce1-11/+34
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolssd: expand children pool when necessarySimo Sorce1-7/+34
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolssd: Use parametric option for prefork parametersSimo Sorce1-12/+48
example: spoolssd:prefork = 10:100:5 will configure spoolssd to start with a minimum of 10 preforked children, a max set to 100 children and spawns/retires 5 children at a time when ramping up/scaling down. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolss: make listening asynchronousSimo Sorce1-26/+60
This also allows to make each children serve more than one client at the same time if necessary. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10s3-spoolssd: Use the prefork framework in spoolssdSimo Sorce1-3/+425
This should make it more scalable and able to handle easily multiple clients at the same time. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-01s3-rpc_server: Use binding vector in rpc_ep_try_register().Andreas Schneider1-2/+22
2011-08-01s3-rpc_server: Move the endpoint registration to own file.Andreas Schneider1-2/+2
2011-07-18s3-rpc_server: Fixed segfaults in rpc daemons.Andreas Schneider1-1/+1
Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Mon Jul 18 14:01:02 CEST 2011 on sn-devel-104
2011-07-01s3-printing: split out printing migration code into a smaller library.Günther Deschner1-1/+1
Guenther
2011-05-05s3-printing: run minimal_includes.pl.Günther Deschner1-2/+0
Guenther
2011-05-02s3: include ntdomain.h before including generated srv_ headers.Günther Deschner1-0/+1
Guenther
2011-05-02s3-proto: move remaining spoolss protos to own header file.Günther Deschner1-0/+1
Guenther
2011-05-02s3-proto: move rpc_srv_register protos and structs to town headerfile.Günther Deschner1-0/+1
Guenther
2011-03-30s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner1-1/+0
Guenther