main.cc
Go to the documentation of this file.
272 debugs(1, Important(2), "Preparing for shutdown after " << statCounter.client_http.requests << " requests");
325 "Usage: %s [-cdzCFNRVYX] [-n name] [-s | -l facility] [-f config-file] [-[au] port] [-k signal]"
593 fatalf("Service name (-n option) must be limited to 32 characters but got %u", service_name.length());
647 printf("For legal restrictions on distribution see https://www.openssl.org/source/license.html\n\n");
1092 debugs(50, DBG_CRITICAL, "WARNING: Can't find current directory, getcwd: " << xstrerr(xerrno));
1113 debugs(1, DBG_CRITICAL, "Starting Squid Cache version " << version_string << " for " << CONFIG_HOST_TYPE << "...");
1165 httpHeaderInitModule(); /* must go before any header processing (e.g. the one in errorInitialize) */
1306 debugs(1, DBG_CRITICAL, "FATAL: Dying after an undetermined failure" << CurrentExceptionExtra);
struct timeval squid_start
int opt_send_signal
Definition: Scheme.cc:17
struct SquidConfig::@85 Port
void create() override
create system resources needed for this store to operate in the future
Definition: Controller.cc:73
Definition: forward.h:27
Definition: main.cc:183
static void masterReconfigureFinish()
Ends reconfiguration sequence started by masterReconfigureStart().
Definition: main.cc:1802
static void mainHandleCommandLineOption(const int optId, const char *optValue)
Definition: main.cc:407
int opt_store_doublecheck
Definition: comm.h:108
int KidIdentifier
SBuf ProcessRoles()
a string describing this process roles such as worker or coordinator
Definition: tools.cc:739
bool someSignaled(const int sgnl) const
whether some kids died from a given signal
Definition: Kids.cc:116
static bool mainChangeDir(const char *dir)
changes working directory, providing error reporting
Definition: main.cc:1048
bool hasOption(const int optId, const char **optValue=nullptr) const
Definition: CommandLine.cc:71
static bool AvoidSignalAction(const char *description, volatile int &signalVar)
Definition: main.cc:238
int callback() override
called once every main loop iteration; TODO: Move to UFS code.
Definition: Controller.cc:223
SBuf service_name(APP_SHORTNAME)
Definition: main.cc:193
void forEachOption(Visitor) const
calls Visitor for each of the configured command line option
Definition: CommandLine.cc:89
bool shouldRestartSome() const
whether some kids should be restarted by master
Definition: Kids.cc:136
static void ConfigureSyslog(const char *facility)
enables logging to syslog (using the specified facility, when not nil)
Definition: debug.cc:1083
DWORD WIN32_IpAddrChangeMonitorInit()
Definition: windows_service.cc:441
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:47
struct StatCounters::@111 client_http
static int SquidMainSafe(int argc, char **argv)
unsafe main routine wrapper to catch exceptions
Definition: main.cc:1343
#define RunRegisteredHere(m)
convenience macro to describe/debug the caller and the method being called
Definition: RunnersRegistry.h:117
int opt_no_daemon
#define TexcHere(msg)
legacy convenience macro; it is not difficult to type Here() now
Definition: TextException.h:63
static void RegisterModules()
register all known modules for handling future RegisteredRunner events
Definition: main.cc:1440
void LoadableModulesConfigure(const SBufList &names)
dynamically load named libraries, in the listed order
Definition: LoadableModules.cc:28
const char * version_string
static void RegisterWithCacheManager(void)
Definition: SBufStatsAction.cc:124
static void ConfigureDebugging()
Start directing debugs() messages to the configured cache.log.
Definition: main.cc:1388
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
Definition: gadgets.cc:18
void releaseServerSockets(void) STUB_NOP void dumpMallocStats(void) STUB void squid_getrusage(struct rusage *) STUB double rusage_cputime(struct rusage *) STUB_RETVAL(0) int rusage_maxrss(struct rusage *) STUB_RETVAL(0) int rusage_pagefaults(struct rusage *) STUB_RETVAL(0) void PrintRusage(void) STUB void death(int) STUB void BroadcastSignalIfAny(int &) STUB void sigusr2_handle(int) STUB void debug_trap(const char *) STUB void sig_child(int) STUB const char *getMyHostname(void) STUB_RETVAL(nullptr) const char *uniqueHostname(void) STUB_RETVAL(nullptr) void leave_suid(void) STUB_NOP void enter_suid(void) STUB void no_suid(void) STUB bool IamMasterProcess()
Definition: stub_tools.cc:18
void resetArg0(const char *programName)
replaces argv[0] with the new value
Definition: CommandLine.cc:115
time_t getCurrentTime() STUB_RETVAL(0) int tvSubUsec(struct timeval
launches PeerPoolMgrs for peers configured with standby.limit
Definition: PeerPoolMgr.cc:245
bool IamDiskProcess() STUB_RETVAL_NOP(false) bool InDaemonMode() STUB_RETVAL_NOP(false) bool UsingSmp() STUB_RETVAL_NOP(false) bool IamCoordinatorProcess() STUB_RETVAL(false) bool IamPrimaryProcess() STUB_RETVAL(false) int NumberOfKids() STUB_RETVAL(0) void setMaxFD(void) STUB void setSystemLimits(void) STUB void squid_signal(int
whether the current process is dedicated to managing a cache_dir
static void ForgetSaved()
silently erases saved early debugs() messages (if any)
Definition: debug.cc:554
Manages arguments passed to a program (i.e., main(argc, argv) parameters).
Definition: CommandLine.h:34
void CpuAffinityCheck()
check CPU affinity configuration and print warnings if needed
Definition: CpuAffinity.cc:49
static void EnsureDefaultStderrLevel(int maxDefault)
Definition: debug.cc:693
Definition: AsyncEngine.h:18
int starting_up
Definition: EventLoop.h:26
std::ostream & CurrentExceptionExtra(std::ostream &os)
Definition: TextException.cc:99
bool SIGHDLR int STUB void const char void ObjPackMethod STUB void const char *STUB void keepCapabilities(void) STUB pid_t WaitForOnePid(pid_t
reacts to RegisteredRunner events relevant to this module
Definition: peer_userhash.cc:144
int reconfiguring
static void GoIntoBackground()
makes the caller a daemon process running in the background
Definition: main.cc:1860
initializes shared queue used by CollapsedForwarding
Definition: CollapsedForwarding.cc:174
int opt_create_swap_dirs
std::ostream & CurrentException(std::ostream &os)
prints active (i.e., thrown but not yet handled) exception
Definition: TextException.cc:88
int opt_reuseaddr
Definition: cache_cf.cc:4369
Definition: Tokenizer.h:29
int opt_foreground
int Squid_MaxFD
Receives coordination messages on behalf of its process or thread.
Definition: Strand.h:27
bool IamMasterProcess()
whether the current process is the parent of all other Squid processes
Definition: tools.cc:668
Definition: Stream.h:20
static void masterReconfigureStart()
Initiates reconfiguration sequence. See also: masterReconfigureFinish().
Definition: main.cc:1789
void Parse()
interprets (and partially applies) squid.conf or equivalent configuration
Definition: cache_cf.cc:610
int opt_reload_hit_only
GlobalContextStorage TheGlobalContextStorage
Global cache for store all SSL server certificates.
Definition: context_storage.cc:123
void reconfigureStart()
When reconfigring should be called this method.
Definition: context_storage.cc:91
static SBuf ConfigurationFailureMessage()
error message to log when Configuration::Parse() fails
Definition: main.cc:880
reacts to RegisteredRunner events relevant to this module
Definition: peer_sourcehash.cc:132
Definition: client_db.cc:99
Definition: parse.c:160
int cmp(const SBuf &S, const size_type n) const
shorthand version for compare()
Definition: SBuf.h:279
char * ConfigFile
virtual void finishShutdown()
Meant for cleanup of services needed by the already destroyed objects.
Definition: RunnersRegistry.h:91
static void masterMaintainKidRevivalSchedule()
Definition: main.cc:1842
Definition: MemStore.cc:971
bool IamCoordinatorProcess()
whether the current process coordinates worker processes
Definition: tools.cc:702
void wccp2Init(void) STUB void wccp2ConnectionOpen(void) STUB void wccp2ConnectionClose(void) STUB void dump_wccp2_method(StoreEntry *
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
Definition: Stream.h:63
int opt_parse_cfg_only
static void ConfigureCurrentKid(const CommandLine &cmdLine)
computes name and ID for the current kid process
Definition: main.cc:1360
#define CallRunnerRegistratorIn(Namespace, ClassName)
Definition: RunnersRegistry.h:151
static void masterShutdownStart()
Initiates shutdown sequence. Shutdown ends when the last running kids stops.
Definition: main.cc:1779
optimized set of C chars, with quick membership test and merge support
Definition: CharacterSet.h:17
int opt_foreground_rebuild
int opt_catch_signals
bool UsingSmp()
Whether there should be more than one worker process running.
Definition: tools.cc:696
Definition: IpcIoFile.cc:1013
bool SIGHDLR int STUB void const char void ObjPackMethod STUB void parseEtcHosts(void) STUB int getMyPort(void) STUB_RETVAL(0) void setUmask(mode_t) STUB void strwordquote(MemBuf *
struct SquidConfig2::@109 onoff
int WIN32_Subsystem_Init(int *argc, char ***argv)
Definition: windows_service.cc:459
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:107
static void master_shutdown(int sig)
Shutdown signal handler for master process.
Definition: main.cc:739
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products