summaryrefslogtreecommitdiffstats
path: root/source3/printing/queue_process.c
Commit message (Collapse)AuthorAgeFilesLines
* s3: printing: Fix problem with server taking too long to respond to a ↵Jeremy Allison2014-02-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSG_PRINTER_DRVUPGRADE message. Receiving a MSG_PRINTER_DRVUPGRADE causes smbd to iterate over all printers looking for ones that uses the driver. This is a very expensive operation requiring a read of all registry printer parameters. On a system with a large number of printers, this causes the clients to timeout (smbd can take longer than 60 seconds to respond). This patch fixes the problem by forwarding the MSG_PRINTER_DRVUPGRADE to the background lpq queue updater process and allowing it to take care of the updating of the changeid in the registry, allowing the smbd connected to the client to return to processing requests immediately. https://bugzilla.samba.org/show_bug.cgi?id=9942 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Feb 18 17:48:30 CET 2014 on sn-devel-104
* s3-daemons: Set the comment field of the daemons.Andreas Schneider2013-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR_SET_NAME sets the comm field of a process. This way we can give processes a name and they are easier to identify. $ ps afx -o pid,comm 29447 smbd 29452 \_ epmd 29453 \_ lsasd-master 29455 | \_ lsasd-child 29457 | \_ lsasd-child 29459 | \_ lsasd-child 29461 | \_ lsasd-child 29463 | \_ lsasd-child 29454 \_ spoolssd-master 29456 \_ lpqd 29458 \_ spoolssd-child 29460 \_ spoolssd-child 29462 \_ spoolssd-child 29465 \_ spoolssd-child 29466 \_ spoolssd-child 29467 \_ spoolssd-child 29468 \_ spoolssd-child 29469 \_ spoolssd-child 29470 \_ spoolssd-child 29471 \_ spoolssd-child Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3:printing: s/struct event_context/struct tevent_contextStefan Metzmacher2013-02-191-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3fs-smbd: Move housekeeping to the background process.Andreas Schneider2012-10-011-0/+9
| | | | | | | | | | | | | | | | If you add 200 printers using lpadmin. Then you wait for the printcap cache to expire. As soon as this expires we notify all deamons that they should reload the printers. This mean we need to create the default registry keys for each printer. If you do e.g. a 'smbclient -L' during that time you will get a lot of timeouts. This lets the housekeeping function of the printcap cache do the task of creating the default registry keys in background queue process. When it is done with the task it will tell all smbd childs to reload the printers and the 200 printers appear. Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Oct 1 20:28:23 CEST 2012 on sn-devel-104
* s3:printing: use smbd/smbd.h instead of just smbd/proto.h in queue_process.cStefan Metzmacher2012-06-061-1/+1
| | | | | | This fixes compiler warnings regarding incomplete types. metze
* lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij2012-03-241-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
* s3:printing: avoid messaging_event_context() in print_queue_housekeeping()Stefan Metzmacher2012-01-171-6/+21
| | | | metze
* s3: Remove a call to procid_self()Volker Lendecke2011-12-131-1/+1
|
* s3: Remove a bunch of calls to procid_self()Volker Lendecke2011-12-121-1/+1
| | | | All callers to messaging_[re]init only used procid_self()
* s3-smbd: Rename reload_printers() and add documentation.Andreas Schneider2011-09-051-2/+2
| | | | | Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Mon Sep 5 17:59:47 CEST 2011 on sn-devel-104
* s3-rpc_server: Replace RPC_SERVICE_MODE_DAEMON checksSimo Sorce2011-08-211-3/+2
| | | | | | | Use rpc_daemon_type() macros where appropriate instead. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-messaging: Do not register to classes we are not going to use.Simo Sorce2011-08-111-2/+2
| | | | | | | 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
* s3-printing: Do not try to force reload.Simo Sorce2011-08-101-1/+5
| | | | | | | | | | Be more correct in load printers at startup. If async process have already started we do not need to force a reload, but we just need to load the printers. If other process have not finished initializing it makes no sense to try to force them as they are masking SIGHUP unitl init is done anyway. Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-printing: Add child handler to bq processSimo Sorce2011-08-101-4/+32
| | | | | | | | The cups backend forks a child to do asynchronous work. We need a sigchld handler in bq to properly wait for the chilod to finish and reap it, otherwise it hangs the forever as a zombie process. Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-printing: make sure to block SIGHUP ...Simo Sorce2011-08-101-0/+19
| | | | | | | | ... 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>
* s3-printing: Allow bq process to have own logfileSimo Sorce2011-08-101-2/+13
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-printing: Force pcap reload when all readySimo Sorce2011-08-101-2/+10
| | | | | | | This way we are sure the cache is primed properly and messages can be sent to processes if necessary as all messaging has been set up. Signed-off-by: Andreas Schneider <asn@samba.org>
* s3:spoolssd Start spoolssd from printing_subsystem_initSimo Sorce2011-08-101-2/+13
| | | | | | | 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>
* s3-printing: Rework how the background process is startedSimo Sorce2011-08-101-19/+31
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-printing: No need to register to smbd's children listSimo Sorce2011-08-101-19/+0
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-printing: fix some build warnings in queue_process.cGünther Deschner2011-08-031-1/+2
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Aug 3 17:48:33 CEST 2011 on sn-devel-104
* s3:server Consolidate printing related initializationSimo Sorce2011-08-021-0/+4
| | | | | | | Signed-off-by: Günther Deschner <gd@samba.org> Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Tue Aug 2 17:37:44 CEST 2011 on sn-devel-104
* s3:smbd - Move printing queue stuffSimo Sorce2011-08-021-0/+294
This way we can properly deal with pcap updates in the background queue process if it is enabled (on by default) and not perform these actions in the main smbd process. Signed-off-by: Günther Deschner <gd@samba.org>