Passenger: AgentsStarter.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List

# AgentsStarter.h

    00001 /*
    00002  *  Phusion Passenger - http://www.modrails.com/
    00003  *  Copyright (c) 2010 Phusion
    00004  *
    00005  *  "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
    00006  *
    00007  *  Permission is hereby granted, free of charge, to any person obtaining a copy
    00008  *  of this software and associated documentation files (the "Software"), to deal
    00009  *  in the Software without restriction, including without limitation the rights
    00010  *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    00011  *  copies of the Software, and to permit persons to whom the Software is
    00012  *  furnished to do so, subject to the following conditions:
    00013  *
    00014  *  The above copyright notice and this permission notice shall be included in
    00015  *  all copies or substantial portions of the Software.
    00016  *
    00017  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00018  *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00019  *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    00020  *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00021  *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    00022  *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    00023  *  THE SOFTWARE.
    00024  */
    00025
    00026 /* C wrappers for Passenger::AgentsStarter. */
    00027 #ifndef _PASSENGER_AGENTS_STARTER_H_
    00028 #define _PASSENGER_AGENTS_STARTER_H_
    00029
    00030 #include <sys/types.h>
    00031 #include <unistd.h>
    00032
    00033 #ifdef __cplusplus
    00034         extern "C" {
    00035 #endif
    00036
    00037
    00038 typedef void AgentsStarter;
    00039
    00040 typedef enum {
    00041         AS_APACHE,
    00042         AS_NGINX
    00043 } AgentsStarterType;
    00044
    00045 typedef void (*AfterForkCallback)(void *);
    00046
    00047 AgentsStarter *agents_starter_new(AgentsStarterType type, char **error_message);
    00048 int  agents_starter_start(AgentsStarter *as,
    00049                           int logLevel, const char *debugLogFile,
    00050                           pid_t webServerPid,
    00051                           const char *tempDir, int userSwitching,
    00052                           const char *defaultUser, const char *defaultGroup,
    00053                           uid_t webServerWorkerUid, gid_t webServerWorkerGid,
    00054                           const char *passengerRoot,
    00055                           const char *rubyCommand, unsigned int maxPoolSize,
    00056                           unsigned int maxInstancesPerApp,
    00057                           unsigned int poolIdleTime,
    00058                           const char *analyticsServer,
    00059                           const char *analyticsLogDir, const char *analyticsLogUser,
    00060                           const char *analyticsLogGroup, const char *analyticsLogPermissions,
    00061                           const char *unionStationGatewayAddress,
    00062                           unsigned short unionStationGatewayPort,
    00063                           const char *unionStationGatewayCert,
    00064                           const char **prestartURLs, unsigned int prestartURLsCount,
    00065                           const AfterForkCallback afterFork,
    00066                           void *callbackArgument,
    00067                           char **errorMessage);
    00068 const char *agents_starter_get_request_socket_filename(AgentsStarter *as, unsigned int *size);
    00069 const char *agents_starter_get_request_socket_password(AgentsStarter *as, unsigned int *size);
    00070 const char *agents_starter_get_server_instance_dir(AgentsStarter *as);
    00071 const char *agents_starter_get_generation_dir(AgentsStarter *as);
    00072 pid_t       agents_starter_get_pid(AgentsStarter *as);
    00073 void        agents_starter_detach(AgentsStarter *as);
    00074 void        agents_starter_free(AgentsStarter *as);
    00075
    00076
    00077 #ifdef __cplusplus
    00078         }
    00079 #endif
    00080
    00081 #endif /* _PASSENGER_AGENTS_STARTER_H_ */