summaryrefslogtreecommitdiff
path: root/source4/smbd/process_model.h
Commit message (Collapse)AuthorAgeFilesLines
* source4/smbd: refactor the process model for preforkGary Lockyer2017-10-191-6/+9
| | | | | | | | | | | | | | | | | | Refactor the process model code to allow the addition of a prefork process model. - Add a process context to contain process model specific state - Add a service details structure to allow service to indicate which process model options they can support. In the new code the services advertise the features they support to the process model. The process model context is plumbed through to allow the process model to keep track of the supported options, and any state the process model may require. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* source4 smbd: remove global control pipe from process_standard.Gary Lockyer2017-09-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standard model uses a pipe to signal the worker processes spawned on accept that the controlling process has terminated and that they should shut down. This pipe is currently a static global variable in process_standard.c. This patch replaces that global pipe with a file descriptor passed into the process model init functions, giving a single mechanism across all process models. This paves the way for the addition of a pre-fork process model. Ensuring that the correct file descriptors are closed, is difficult so it is best do this only once rather than require the process models to do this individually. Notes on debugging pipe ownership: Add code to log the process id and the file descriptor of the writeable pipe. run: lsof | grep FIFO | grep samba | grep <process id> this will produce lines like: samba 25624 him 4w FIFO 0,10 0t0 472206 pipe where: 4w is the file descriptor and mode and the number to the left of "pipe" is the pipe id. then: lsof | grep FIFO | grep samba | grep <pipe id> This will display all the processes with the pipe open and the mode only the smbd master process should have it open in write mode. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Sep 28 02:08:34 CEST 2017 on sn-devel-144
* s4-server: cleanup allocation of process modelsAndrew Tridgell2010-11-031-1/+1
| | | | | Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Wed Nov 3 10:40:52 UTC 2010 on sn-devel-104
* s4-smbd: don't initialise process models more than onceAndrew Tridgell2010-10-301-2/+3
| | | | | | | | | this also removes the event_context parameter from process model initialisation. It isn't needed, and is confusing when a process model init can be called from more than one place, possibly with different event contexts. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-loadparm: 2nd half of lp_ to lpcfg_ conversionAndrew Tridgell2010-07-161-2/+2
| | | | | | | this converts all callers that use the Samba4 loadparm lp_ calling convention to use the lpcfg_ prefix. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4:lib/tevent: rename structsStefan Metzmacher2008-12-291-8/+8
| | | | | | | | | | | | | | | | | | | | list="" list="$list event_context:tevent_context" list="$list fd_event:tevent_fd" list="$list timed_event:tevent_timer" for s in $list; do o=`echo $s | cut -d ':' -f1` n=`echo $s | cut -d ':' -f2` r=`git grep "struct $o" |cut -d ':' -f1 |sort -u` files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4` for f in $files; do cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp mv $f.tmp $f done done metze
* Eliminate another global_loadparm.Jelmer Vernooij2008-09-301-1/+2
|
* s4: allways initialize the process model before it's usedStefan Metzmacher2008-09-221-1/+0
| | | | metze
* Install public header files again and include required prototypes.Jelmer Vernooij2008-04-021-1/+4
| | | | (This used to be commit 47ffbbf67435904754469544390b67d34c958343)
* Remaining changes to implement the prefork process modelAndrew Bartlett2008-02-041-1/+2
| | | | | | | | | | | | | | | | | | | To use, run 'smbd -M prefork' By default, only the smb service is preforked. 4 children are created, and all listen for new connections. The Linux Kernel 'wake one' behaviour should ensure that only one is given the oportunity to accept. We need to look into the ideal number of worker children, as well as load balancing behaviours. To change, set: prefork children : smb = 6 valid service names (smb in this example) match those in 'server services'. Andrew Bartlett and David Disseldorp (This used to be commit 35313c0aa3fbfdd943edfb7bafd7645b1a0c54e9)
* r26672: Janitorial: Remove uses of global_loadparm.Jelmer Vernooij2008-01-051-3/+10
| | | | (This used to be commit 18cd08623eaad7d2cd63b82ea5275d4dfd21cf00)
* r24937: Merge tests spoolss RPC callbacks.Jelmer Vernooij2007-10-101-0/+2
| | | | (This used to be commit 9b256a0ca232ea6e89771bf73a1adf877273a752)
* r23792: convert Samba4 to GPLv3Andrew Tridgell2007-10-101-3/+2
| | | | | | There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa)
* r20646: first preparations for cluster enablement. This changes "Andrew Tridgell2007-10-101-2/+3
| | | | | | | | | | | uint32_t server_id to struct server_id server_id; which allows a server ID to have an node number. The node number will be zero in non-clustered case. This is the most basic hook needed for clustering, and ctdb. (This used to be commit 2365abaa991d57d68c6ebe9be608e01c907102eb)
* r14380: Reduce the size of structs.hJelmer Vernooij2007-10-101-0/+5
| | | | (This used to be commit 1a16a6f1dfa66499af43a6b88b3ea69a6a75f1fe)
* r14079: I just found the setproctitle library from alt linux:-)Stefan Metzmacher2007-10-101-1/+3
| | | | | | | | | - add set_title hook to the process models - use setproctitle library in process_model standard if available - the the title for the task servers and on connections metze (This used to be commit 526f20bbecc9bbd607595637c15fc4001d3f0c70)
* r13924: Split more prototypes out of include/proto.h + initial work on headerJelmer Vernooij2007-10-101-0/+2
| | | | | file dependencies (This used to be commit 122835876748a3eaf5e8d31ad1abddab9acb8781)
* r5304: removed lib/socket/socket.h from includes.hAndrew Tridgell2007-10-101-0/+2
| | | | (This used to be commit b902ea546d2d1327b23f40ddaeeaa8e7e3662454)
* r5185: make all the events data structures private to events.c. This willAndrew Tridgell2007-10-101-2/+0
| | | | | | | | | | | make it possible to add optimisations to the events code such as keeping the next timed event in a sorted list, and using epoll for file descriptor events. I also removed the loop events code, as it wasn't being used anywhere, and changed timed events to always be one-shot (as adding a new timed event in the event handler is so easy to do if needed) (This used to be commit d7b4b6de51342a65bf46fce772d313f92f8d73d3)
* r5104: - added support for task based servers. These are servers that withinAndrew Tridgell2007-10-101-2/+8
| | | | | | | | | | | | themselves are run as a single process, but run as a child of the main process when smbd is run in the standard model, and run as part of the main process when in the single mode. - rewrote the winbind template code to use the new task services. Also fixed the packet queueing - got rid of event_context_merge() as it is no longer needed (This used to be commit 339964a596689278d2138cff05d7d444798a3504)
* r5102: This is a major simplification of the logic for controlling top levelAndrew Tridgell2007-10-101-22/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | servers in smbd. The old code still contained a fairly bit of legacy from the time when smbd was only handling SMB connection. The new code gets rid of all of the smb_server specific code in smbd/, and creates a much simpler infrastructures for new server code. Major changes include: - simplified the process model code a lot. - got rid of the top level server and service structures completely. The top level context is now the event_context. This got rid of service.h and server.h completely (they were the most confusing parts of the old code) - added service_stream.[ch] for the helper functions that are specific to stream type services (services that handle streams, and use a logically separate process per connection) - got rid of the builtin idle_handler code in the service logic, as none of the servers were using it, and it can easily be handled by a server in future by adding its own timed_event to the event context. - fixed some major memory leaks in the rpc server code. - added registration of servers, rather than hard coding our list of possible servers. This allows for servers as modules in the future. - temporarily disabled the winbind code until I add the helper functions for that type of server - added error checking on service startup. If a configured server fails to startup then smbd doesn't startup. - cleaned up the command line handling in smbd, removing unused options (This used to be commit cf6a46c3cbde7b1eb1b86bd3882b953a2de3a42e)
* r4728: split up server_services into:Stefan Metzmacher2007-10-101-7/+9
| | | | | | | | | | | | | | | | | | | - stream_socket services the smb, ldap and rpc service which sets up a srtam socket end then waits for connections and - task services which this you can create a seperate task that do something (this is also going through the process_model subsystem so with -M standard a new process for this created with -M thread a new thread ... I'll add datagram services later when we whave support for datagram sockets in lib/socket/ see the next commit as an example for service_task's metze (This used to be commit d5fa02746c6569b09b6e05785642da2fad3ba3e0)
* r3507: - added deferred replies on sharing violation in pvfs open. TheAndrew Tridgell2007-10-101-2/+4
| | | | | | | | | | | | | deferred reply is short-circuited immediately when the file is closed by another user, allowing it to be opened by the waiting user. - added a sane set of timeval manipulation routines - converted all the events code and code that uses it to use struct timeval instead of time_t, which allows for microsecond resolution instead of 1 second resolution. This was needed for doing the pvfs deferred open code, and is why the patch is so big. (This used to be commit 0d51511d408d91eb5f68a35e980e0875299b1831)
* r3012: added initial support for byte range locking in the posix vfs. This isAndrew Tridgell2007-10-101-2/+0
| | | | | | enough for us to pass locktest, but does not yet support lock timeouts and some of the other esoteric features. (This used to be commit 58a92abd88f190bc60894a68e0528e95ae33fe39)
* r1486: commit the start of the generic server infastructureStefan Metzmacher2007-10-101-10/+7
| | | | | | | | | | | | | | | | | | | the idea is to have services as modules (smb, dcerpc, swat, ...) the process_model don't know about the service it self anymore. TODO: - the smbsrv should use the smbsrv_send function - the service subsystem init should be done like for other modules - we need to have a generic socket subsystem, which handle stream, datagram, and virtuell other sockets( e.g. for the ntvfs_ipc module to connect to the dcerpc server , or for smb or dcerpc or whatever to connect to a server wide auth service) - and other fixes... NOTE: process model pthread seems to be broken( but also before this patch!) metze (This used to be commit bbe5e00715ca4013ff0dbc345aa97adc6b5c2458)
* r1291: rename struct smbsrv_context to smbsrv_connectionStefan Metzmacher2007-10-101-2/+2
| | | | | | | | | | | | because this is the connection state per transport layer (tcp) connection I also moved the substructs directly into smbsrv_connection, because they don't need a struct name and we should allway pass the complete smbsrv_connection struct into functions metze (This used to be commit 60f823f201fcedf5473008e8453a6351e73a92c7)
* r1280: rename struct request_context to smbsrv_requestStefan Metzmacher2007-10-101-1/+1
| | | | | metze (This used to be commit a85d2db5826a84b812ea5162a11f54edd25f74e3)
* r1277: rename struct server_context to smbsrv_ontextStefan Metzmacher2007-10-101-2/+2
| | | | | | | because I need server_context fot the generic server infastructure metze (This used to be commit 0712f9f30797e65362c99423c0cf158a2f539000)
* r889: convert samba4 to use [u]int16_t instead of [u]int16Stefan Metzmacher2007-10-101-2/+2
| | | | | metze (This used to be commit af6f1f8a01bebbecd99bc8c066519e89966e65e3)
* - we now specify the object files in the subsystems config.m4 fileStefan Metzmacher2004-02-021-0/+69
I plan to convert all objectfile group to use SMB_SUBSYSTEM later I'll add a SMB_BINARY() and SMB_LIBRARY(), then there will be no more need to touch Makefile.in, because all make rules will be autogenerated by configure - convert the PROCESS_MODEL subsystem to this new scheme and move the pthread test to smbd/process_model.m4 - convert the CHARSET subsystem to this new scheme and move the iconv test to lib/iconv.m4 (This used to be commit 2e57ee884ebea194ee79ac20e84e385481b56aa2)