#include "squid.h"
#include "AccessLogEntry.h"
#include "acl/Asn.h"
#include "acl/forward.h"
#include "anyp/UriScheme.h"
#include "auth/Config.h"
#include "auth/Gadgets.h"
#include "AuthReg.h"
#include "base/RunnersRegistry.h"
#include "base/Subscription.h"
#include "base/TextException.h"
#include "cache_cf.h"
#include "CachePeer.h"
#include "carp.h"
#include "client_db.h"
#include "client_side.h"
#include "comm.h"
#include "CommandLine.h"
#include "ConfigParser.h"
#include "CpuAffinity.h"
#include "DiskIO/DiskIOModule.h"
#include "dns/forward.h"
#include "errorpage.h"
#include "event.h"
#include "EventLoop.h"
#include "ExternalACL.h"
#include "fd.h"
#include "format/Token.h"
#include "fqdncache.h"
#include "fs/Module.h"
#include "fs_io.h"
#include "FwdState.h"
#include "globals.h"
#include "htcp.h"
#include "http/Stream.h"
#include "HttpHeader.h"
#include "HttpReply.h"
#include "icmp/IcmpSquid.h"
#include "icmp/net_db.h"
#include "ICP.h"
#include "ident/Ident.h"
#include "Instance.h"
#include "ip/tools.h"
#include "ipc/Coordinator.h"
#include "ipc/Kids.h"
#include "ipc/Strand.h"
#include "ipcache.h"
#include "mime.h"
#include "neighbors.h"
#include "parser/Tokenizer.h"
#include "Parsing.h"
#include "pconn.h"
#include "peer_sourcehash.h"
#include "peer_userhash.h"
#include "PeerSelectState.h"
#include "profiler/Profiler.h"
#include "redirect.h"
#include "refresh.h"
#include "sbuf/Stream.h"
#include "SBufStatsAction.h"
#include "send-announce.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "stat.h"
#include "StatCounters.h"
#include "Store.h"
#include "store/Disks.h"
#include "store_log.h"
#include "StoreFileSystem.h"
#include "tools.h"
#include "unlinkd.h"
#include "wccp.h"
#include "wccp2.h"
#include "WinSvc.h"
#include "adaptation/Config.h"
#include "adaptation/ecap/Config.h"
#include "adaptation/icap/Config.h"
#include "adaptation/icap/icap_log.h"
#include "ClientDelayConfig.h"
#include "DelayPools.h"
#include "LoadableModules.h"
#include "ssl/context_storage.h"
#include "ssl/helper.h"
#include "esi/Module.h"
#include "snmp_core.h"
#include <cerrno>
#include <process.h>
Go to the source code of this file.
Classes | |
class | StoreRootEngine |
class | SignalEngine |
Enumerations | |
enum | { optForeground = 2, optKid } |
CommandLine option IDs for –long options that lack a short (-x) equivalent. More... | |
Functions | |
void | WIN32_svcstatusupdate (DWORD, DWORD) |
void WINAPI | WIN32_svcHandler (DWORD) |
static void | mainRotate (void) |
static void | mainReconfigureStart (void) |
static void | mainReconfigureFinish (void *) |
static void | mainInitialize (void) |
static void | usage (void) |
static void | mainHandleCommandLineOption (const int optId, const char *optValue) |
static void | sendSignal (void) |
static void | serverConnectionsOpen (void) |
static void | serverConnectionsClose (void) |
static void | watch_child (const CommandLine &) |
static void | setEffectiveUser (void) |
static void | SquidShutdown (void) |
static void | mainSetCwd (void) |
set the working directory. More... | |
static bool | AvoidSignalAction (const char *description, volatile int &signalVar) |
void | rotate_logs (int sig) |
void | reconfigure (int sig) |
void | master_revive_kids (int sig) |
void | master_shutdown (int sig) |
Shutdown signal handler for master process. More... | |
void | shut_down (int sig) |
void | sig_child (int sig) |
static bool | mainChangeDir (const char *dir) |
changes working directory, providing error reporting More... | |
static void | OnTerminate () |
int | SquidMain (int argc, char **argv) |
unsafe main routine – may throw More... | |
static int | SquidMainSafe (int argc, char **argv) |
unsafe main routine wrapper to catch exceptions More... | |
void WINAPI | SquidWinSvcMain (int argc, char **argv) |
int | main (int argc, char **argv) |
static void | ConfigureCurrentKid (const CommandLine &cmdLine) |
computes name and ID for the current kid process More... | |
static void | ConfigureDebugging () |
static void | RunConfigUsers () |
static void | StartUsingConfig () |
static void | mainStartScript (const char *prog) |
static void | masterShutdownStart () |
Initiates shutdown sequence. Shutdown ends when the last running kids stops. More... | |
static void | masterReconfigureStart () |
Initiates reconfiguration sequence. See also: masterReconfigureFinish(). More... | |
static void | masterReconfigureFinish () |
Ends reconfiguration sequence started by masterReconfigureStart(). More... | |
static void | masterReviveKids () |
Reacts to the kid revival alarm. More... | |
static void | masterCheckAndBroadcastSignals () |
static void | masterMaintainKidRevivalSchedule () |
static bool | masterSignaled () |
static void | GoIntoBackground () |
makes the caller a daemon process running in the background More... | |
static void | masterExit () |
Variables | |
static int | opt_install_service = FALSE |
static int | opt_remove_service = FALSE |
static int | opt_command_line = FALSE |
static int | opt_signal_service = FALSE |
static char * | opt_syslog_facility = NULL |
static int | icpPortNumOverride = 1 |
static int | configured_once = 0 |
static volatile int | do_reconfigure = 0 |
static volatile int | do_rotate = 0 |
static volatile int | do_shutdown = 0 |
static volatile int | do_revive_kids = 0 |
static volatile int | shutdown_status = EXIT_SUCCESS |
static volatile int | do_handle_stopped_child = 0 |
static int | RotateSignal = -1 |
static int | ReconfigureSignal = -1 |
static int | ShutdownSignal = -1 |
static int | ReviveKidsSignal = -1 |
static const char * | squid_start_script = "squid_start" |
static const char * | shortOpStr |
static struct option | squidOptions [] |
bool | Chrooted = false |
Enumeration Type Documentation
◆ anonymous enum
Function Documentation
◆ AvoidSignalAction()
|
static |
Decides whether the signal-controlled action X should be delayed, canceled, or executed immediately. Clears do_X (via signalVar) as needed.
Definition at line 259 of file main.cc.
References configured_once, DBG_IMPORTANT, debugs, reconfiguring, and shutting_down.
Referenced by SignalEngine::doShutdown(), mainReconfigureStart(), mainRotate(), masterReconfigureStart(), masterReviveKids(), and masterShutdownStart().
◆ ConfigureCurrentKid()
|
static |
Definition at line 1412 of file main.cc.
References APP_SHORTNAME, SBuf::assign(), SBuf::c_str(), SBuf::cmp(), CharacterSet::DIGIT, CommandLine::hasOption(), KidIdentifier, optKid, pkCoordinator, pkDisker, pkOther, pkWorker, TheKidName, TheProcessKind, and xatoi().
Referenced by SquidMain().
◆ ConfigureDebugging()
|
static |
Start directing debugs() messages to the configured cache.log. Until this function is called, all allowed messages go to stderr.
Definition at line 1440 of file main.cc.
References _db_init(), Debug::cache_log, SquidConfig::chroot_dir, Chrooted, Config, Debug::debugOptions, FD_LOG, fd_open(), and opt_no_daemon.
Referenced by StartUsingConfig().
◆ GoIntoBackground()
|
static |
◆ main()
Definition at line 1379 of file main.cc.
References opt_no_daemon, SquidMainSafe(), and WIN32_StartService().
◆ mainChangeDir()
|
static |
Definition at line 1084 of file main.cc.
References DBG_CRITICAL, debugs, and xstrerr().
Referenced by mainSetCwd().
◆ mainHandleCommandLineOption()
|
static |
- C
- Unset/disabel global option for catchign signals. opt_catch_signals
- D
- OBSOLETE: WAS: override to prevent optional startup DNS tests.
- F
- Set global option for foreground rebuild. opt_foreground_rebuild
- N
- Set global option for 'no_daemon' mode. opt_no_daemon
- O
- Set global option. opt_command_lin and WIN32_Command_Line
- R
- Unset/disable global option opt_reuseaddr
- S
- Set global option opt_store_doublecheck
- X
- Force full debugging
- Y
- Set global option opt_reload_hit_only
- i
- Set global option opt_install_service (to TRUE)
- a
- Add optional HTTP port as given following the option
- d
- Set global option Debug::log_stderr to the number given following the option
- f
- Load the file given instead of the default squid.conf.
- k
- Run the administrative action given following the option
- When it is missing or an unknown option display the usage help.
- On reconfigure send SIGHUP.
- On rotate send SIGQUIT or SIGUSR1.
- On debug send SIGTRAP or SIGUSR2.
- On shutdown send SIGTERM.
- On interrupt send SIGINT.
- On kill send SIGKILL.
- On check send 0 / SIGNULL.
- On parse set global flag to re-parse the config file only.
- m
- Set global malloc_debug_level to the value given following the option. if none is given it toggles the xmalloc_trace option on/off
- n
- Set global option opt_signal_service (to true). Stores the additional parameter given in global service_name
- r
- Set global option opt_remove_service (to TRUE)
- l
- Stores the syslog facility name in global opt_syslog_facility then performs actions for -s option.
- s
- Initialize the syslog for output
- u
- Store the ICP port number given in global option icpPortNumOverride ensuring its a positive number.
- v
- Display squid version and build information. Then exit.
- z
- Set global option Debug::log_stderr and opt_create_swap_dirs
- –foreground
- Set global option opt_foreground
- h,?, or unknown
Definition at line 440 of file main.cc.
References _db_set_syslog(), add_http_port(), CharacterSet::ALPHA, ConfigFile, DBG_CRITICAL, debugs, CharacterSet::DIGIT, fatal(), fatalf(), icpPortNumOverride, SBuf::length(), Debug::log_stderr, OPENSSL_VERSION, OpenSSL_version, opt_catch_signals, opt_command_line, opt_create_swap_dirs, opt_foreground, opt_foreground_rebuild, opt_install_service, opt_no_daemon, opt_parse_cfg_only, opt_reload_hit_only, opt_remove_service, opt_reuseaddr, opt_send_signal, opt_signal_service, opt_store_doublecheck, opt_syslog_facility, optForeground, optKid, Debug::override_X, Debug::parseOptions(), port, service_name, sigusr2_handle(), SQUIDSBUFPH, SQUIDSBUFPRINT, TRUE, usage(), version_string, xatoi(), xfree, and xstrdup.
Referenced by SquidMain().
◆ mainInitialize()
|
static |
Definition at line 1133 of file main.cc.
References accessLogInit(), SquidConfig::announce, authenticateInit(), cbdataRegisterWithCacheManager(), SquidConfig::chroot_dir, Mem::CleanIdlePools(), SquidConfig::ClientDelay, Config, configured_once, DBG_CRITICAL, DBG_IMPORTANT, death(), debugs, errorInitialize(), eventAdd(), eventInit(), externalAclInit(), Adaptation::Config::finalize(), Adaptation::Ecap::Config::finalize(), ClientDelayConfig::finalize(), Adaptation::Config::Finalize(), fqdncache_init(), fqdncache_purgelru(), httpHeaderInitModule(), IamPrimaryProcess(), icapLogOpen(), SquidConfig::icp, icpPortNumOverride, DelayPools::Init(), Esi::Init(), Ssl::Helper::Init(), Ssl::CertValidationHelper::Init(), Dns::Init(), Ident::Init(), FwdState::initModule(), ipcache_init(), ipcache_purgelru(), SquidConfig::loadable_module_names, LoadableModulesConfigure(), mainSetCwd(), Store::Maintain(), memCheckInit(), mimeInit(), SquidConfig::mimeTablePathname, neighbors_init(), no_suid(), Adaptation::Config::onoff, SquidConfig::onoff, opt_catch_signals, parseEtcHosts(), SquidConfig::Port, ProcessRoles(), reconfigure(), redirectInit(), refreshInit(), SBufStatsAction::RegisterWithCacheManager(), rotate_logs(), SA_NODEFER, SA_RESETHAND, SA_RESTART, serverConnectionsOpen(), service_name, setEffectiveUser(), setSystemLimits(), shut_down(), sig_child(), sigusr2_handle(), snmpInit(), Squid_MaxFD, squid_signal(), start_announce(), statInit(), storeInit(), Adaptation::Ecap::TheConfig, Adaptation::Icap::TheConfig, Auth::TheConfig, unlinkdInit(), unlinkdNeeded(), urlInitialize(), version_string, wccp2Init(), wccpInit(), WIN32_IpAddrChangeMonitorInit(), and xprof_event().
Referenced by SquidMain().
◆ mainReconfigureFinish()
|
static |
Definition at line 915 of file main.cc.
References _db_init(), accessLogInit(), SquidConfig::announce, authenticateInit(), Debug::cache_log, SquidConfig::ClientDelay, Config, Config2, ConfigFile, CpuAffinityCheck(), CpuAffinityReconfigure(), DBG_CRITICAL, Debug::debugOptions, debugs, SquidConfig2::enable_purge, enter_suid(), errorClean(), errorInitialize(), eventAdd(), eventDelete(), eventFind(), externalAclInit(), Adaptation::Config::finalize(), Adaptation::Ecap::Config::finalize(), ClientDelayConfig::finalize(), Adaptation::Config::Finalize(), fqdncache_restart(), IamPrimaryProcess(), icapLogOpen(), Dns::Init(), ipcache_restart(), SquidConfig::loadable_module_names, LoadableModulesConfigure(), mimeInit(), SquidConfig::mimeTablePathname, neighbors_init(), NULL, Adaptation::Config::onoff, SquidConfig::onoff, SquidConfig2::onoff, parseConfigFile(), parseEtcHosts(), Ssl::Helper::Reconfigure(), Ssl::CertValidationHelper::Reconfigure(), reconfiguring, redirectReconfigure(), Mem::Report(), RunRegisteredHere, self_destruct(), serverConnectionsOpen(), setEffectiveUser(), setUmask(), start_announce(), storeDirOpenSwapLogs(), storeLogOpen(), RegisteredRunner::syncConfig(), Adaptation::Ecap::TheConfig, Adaptation::Icap::TheConfig, Auth::TheConfig, SquidConfig::umask, unlinkdInit(), unlinkdNeeded(), wccp2Init(), wccpInit(), and SquidConfig::workers.
Referenced by mainReconfigureStart().
◆ mainReconfigureStart()
|
static |
Definition at line 880 of file main.cc.
References accessLogClose(), authenticateReset(), AvoidSignalAction(), DBG_IMPORTANT, debugs, do_reconfigure, eventAdd(), externalAclShutdown(), htcpClosePorts(), icapLogClose(), icpClosePorts(), mainReconfigureFinish(), NULL, Ssl::GlobalContextStorage::reconfigureStart(), reconfiguring, RunRegisteredHere, serverConnectionsClose(), RegisteredRunner::startReconfigure(), storeDirCloseSwapLogs(), storeLogClose(), Ssl::TheGlobalContextStorage, and version_string.
Referenced by SignalEngine::checkEvents().
◆ mainRotate()
|
static |
Definition at line 1036 of file main.cc.
References _db_rotate_log(), accessLogRotate(), authenticateInit(), authenticateRotate(), AvoidSignalAction(), IcmpSquid::Close(), do_rotate, externalAclInit(), externalAclShutdown(), icapLogRotate(), icmpEngine, IcmpSquid::Open(), redirectInit(), redirectShutdown(), storeDirWriteCleanLogs(), storeLogRotate(), and Auth::TheConfig.
Referenced by SignalEngine::checkEvents().
◆ mainSetCwd()
|
static |
Definition at line 1101 of file main.cc.
References SquidConfig::chroot_dir, Chrooted, Config, SquidConfig::coredump_dir, DBG_CRITICAL, DBG_IMPORTANT, debugs, fatalf(), mainChangeDir(), MAXPATHLEN, and xstrerr().
Referenced by mainInitialize(), SquidMain(), and StartUsingConfig().
◆ mainStartScript()
|
static |
Definition at line 1761 of file main.cc.
References MAXPATHLEN, NULL, squid_start_script, WaitForOnePid(), and xstrncpy().
Referenced by watch_child().
◆ master_revive_kids()
void master_revive_kids | ( | int | sig | ) |
Definition at line 754 of file main.cc.
References do_revive_kids, and ReviveKidsSignal.
Referenced by watch_child().
◆ master_shutdown()
void master_shutdown | ( | int | sig | ) |
Definition at line 768 of file main.cc.
References do_shutdown, and ShutdownSignal.
Referenced by watch_child().
◆ masterCheckAndBroadcastSignals()
|
static |
Definition at line 1831 of file main.cc.
References BroadcastSignalIfAny(), DebugSignal, do_reconfigure, do_revive_kids, do_shutdown, masterReconfigureFinish(), masterReconfigureStart(), masterReviveKids(), masterShutdownStart(), ReconfigureSignal, reconfiguring, ReviveKidsSignal, RotateSignal, and ShutdownSignal.
Referenced by watch_child().
◆ masterExit()
|
static |
Definition at line 1887 of file main.cc.
References Kids::allHopeless(), Kids::someSignaled(), and TheKids.
Referenced by watch_child().
◆ masterMaintainKidRevivalSchedule()
|
static |
Maintains the following invariant: An alarm should be scheduled when and only when there are hopeless kid(s) that cannot be immediately revived.
Definition at line 1854 of file main.cc.
References assert, debugs, Kids::forgetOldFailures(), and TheKids.
Referenced by watch_child().
◆ masterReconfigureFinish()
|
static |
Definition at line 1814 of file main.cc.
References reconfiguring.
Referenced by masterCheckAndBroadcastSignals().
◆ masterReconfigureStart()
|
static |
Definition at line 1801 of file main.cc.
References AvoidSignalAction(), debugs, do_reconfigure, Kids::forgetAllFailures(), reconfiguring, and TheKids.
Referenced by masterCheckAndBroadcastSignals().
◆ masterReviveKids()
|
static |
Definition at line 1821 of file main.cc.
References AvoidSignalAction(), Config, debugs, do_revive_kids, and SquidConfig::hopelessKidRevivalDelay.
Referenced by masterCheckAndBroadcastSignals().
◆ masterShutdownStart()
|
static |
Definition at line 1791 of file main.cc.
References AvoidSignalAction(), debugs, do_shutdown, and shutting_down.
Referenced by masterCheckAndBroadcastSignals().
◆ masterSignaled()
|
inlinestatic |
Definition at line 1864 of file main.cc.
References DebugSignal, ReconfigureSignal, ReviveKidsSignal, RotateSignal, and ShutdownSignal.
Referenced by watch_child().
◆ OnTerminate()
|
static |
Definition at line 1352 of file main.cc.
References CurrentException(), DBG_CRITICAL, and debugs.
Referenced by SquidMainSafe().
◆ reconfigure()
void reconfigure | ( | int | sig | ) |
Definition at line 741 of file main.cc.
References do_reconfigure, reconfigure(), and ReconfigureSignal.
Referenced by Mgr::ReconfigureAction::dump(), mainInitialize(), reconfigure(), watch_child(), WIN32_IpAddrChangeMonitor(), and WIN32_svcHandler().
◆ rotate_logs()
void rotate_logs | ( | int | sig | ) |
Definition at line 727 of file main.cc.
References do_rotate, rotate_logs(), and RotateSignal.
Referenced by Mgr::RotateAction::dump(), mainInitialize(), rotate_logs(), watch_child(), and WIN32_svcHandler().
◆ RunConfigUsers()
|
static |
Definition at line 1454 of file main.cc.
References RegisteredRunner::claimMemoryNeeds(), RunRegisteredHere, and RegisteredRunner::useConfig().
Referenced by StartUsingConfig().
◆ sendSignal()
|
static |
Definition at line 1729 of file main.cc.
References opt_send_signal, opt_signal_service, Instance::Other(), pid, StopUsingDebugLog(), TexcHere, ToSBuf(), WIN32_sendSignal(), and xstrerr().
Referenced by SquidMain().
◆ serverConnectionsClose()
|
static |
Definition at line 849 of file main.cc.
References asnFreeMemory(), assert, clientConnectionsClose(), IcmpSquid::Close(), htcpSocketShutdown(), IamPrimaryProcess(), IamWorkerProcess(), icmpEngine, icpConnectionShutdown(), reconfiguring, shutting_down, snmpClosePorts(), wccp2ConnectionClose(), and wccpConnectionClose().
Referenced by SignalEngine::doShutdown(), and mainReconfigureStart().
◆ serverConnectionsOpen()
|
static |
Definition at line 811 of file main.cc.
References asnInit(), carpInit(), clientOpenListenSockets(), htcpOpenPorts(), IamPrimaryProcess(), IamWorkerProcess(), icmpEngine, icpOpenPorts(), ACL::Initialize(), netdbInit(), IcmpSquid::Open(), peerSelectInit(), peerSourceHashInit(), peerUserHashInit(), snmpOpenPorts(), wccp2ConnectionOpen(), and wccpConnectionOpen().
Referenced by mainInitialize(), and mainReconfigureFinish().
◆ setEffectiveUser()
|
static |
Definition at line 1064 of file main.cc.
References DBG_CRITICAL, debugs, fatal(), keepCapabilities(), and leave_suid().
Referenced by mainInitialize(), mainReconfigureFinish(), and SquidMain().
◆ shut_down()
void shut_down | ( | int | sig | ) |
Definition at line 782 of file main.cc.
References do_shutdown, shut_down(), shutdown_status, and ShutdownSignal.
Referenced by Mgr::ShutdownAction::dump(), mainInitialize(), shut_down(), and WIN32_svcHandler().
◆ sig_child()
void sig_child | ( | int | sig | ) |
Definition at line 799 of file main.cc.
References do_handle_stopped_child, and sig_child().
Referenced by mainInitialize(), and sig_child().
◆ SquidMain()
Definition at line 1489 of file main.cc.
References assert, SquidConfig::chroot_dir, comm_init(), Config, ConfigFile, ConfigureCurrentKid(), configured_once, CpuAffinityCheck(), CpuAffinityInit(), Store::Controller::create(), current_time, DBG_CRITICAL, debugs, enter_suid(), EventLoop::errcount, failure_notify, fatal_dump(), RegisteredRunner::finalizeConfig(), CommandLine::forEachOption(), getCurrentTime(), EventScheduler::GetInstance(), IamCoordinatorProcess(), IamDiskProcess(), IamMasterProcess(), IamPrimaryProcess(), IamWorkerProcess(), InDaemonMode(), AnyP::UriScheme::Init(), Format::Token::Init(), Fs::Init(), Mem::Init(), Store::Init(), Acl::Init(), Auth::Init(), Ipc::Coordinator::Instance(), leave_suid(), mainHandleCommandLineOption(), mainInitialize(), mainSetCwd(), no_suid(), NULL, opt_command_line, opt_create_swap_dirs, opt_foreground, opt_install_service, opt_no_daemon, opt_parse_cfg_only, opt_remove_service, opt_send_signal, parseConfigFile(), Debug::parseOptions(), Ip::ProbeTransport(), EventLoop::registerEngine(), Mem::Report(), Store::Root(), EventLoop::run(), RunRegisteredHere, sendSignal(), setEffectiveUser(), EventLoop::setPrimaryEngine(), EventLoop::setTimeService(), setUmask(), StoreFileSystem::SetupAllFs(), DiskIOModule::SetupAllModules(), shortOpStr, Squid_MaxFD, SQUID_MAXFD_LIMIT, squid_start, squidOptions, SquidShutdown(), AsyncJob::Start(), starting_up, StartUsingConfig(), storeFsInit(), Instance::ThrowIfAlreadyRunning(), SquidConfig::umask, UsingSmp(), watch_child(), WIN32_InstallService(), WIN32_RemoveService(), WIN32_SetServiceCommandLine(), WIN32_Subsystem_Init(), WIN32_svcstatusupdate(), Instance::WriteOurPid(), and xstrdup.
Referenced by SquidMainSafe().
◆ SquidMainSafe()
Definition at line 1395 of file main.cc.
References CurrentException(), DBG_CRITICAL, debugs, OnTerminate(), and SquidMain().
Referenced by main(), and SquidWinSvcMain().
◆ SquidShutdown()
|
static |
Definition at line 2070 of file main.cc.
References accessLogClose(), asnFreeMemory(), authenticateReset(), Esi::Clean(), clientdbFreeMemory(), comm_exit(), commCloseAllSockets(), configFreeMemory(), DBG_IMPORTANT, debugs, dumpMallocStats(), errorClean(), eventFreeMemory(), externalAclShutdown(), fdDumpOpen(), RegisteredRunner::finishShutdown(), fqdncacheFreeMemory(), StoreFileSystem::FreeAllFs(), DiskIOModule::FreeAllModules(), Store::FreeMemory(), DelayPools::FreePools(), Adaptation::Config::freeService(), htcpClosePorts(), icpClosePorts(), ipcacheFreeMemory(), memClean(), mimeFreeMemory(), netdbFreeMemory(), PrintRusage(), redirectShutdown(), releaseServerSockets(), Store::Root(), RunRegisteredHere, Ssl::Helper::Shutdown(), Ssl::CertValidationHelper::Shutdown(), shutdown_status, snmpClosePorts(), statFreeMemory(), storeDirWriteCleanLogs(), storeFreeMemory(), storeLogClose(), Store::Controller::sync(), Adaptation::Icap::TheConfig, unlinkdClose(), version_string, wccp2ConnectionClose(), wccpConnectionClose(), and WIN32_svcstatusupdate().
Referenced by SquidMain().
◆ SquidWinSvcMain()
void WINAPI SquidWinSvcMain | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 1372 of file main.cc.
References SquidMainSafe().
◆ StartUsingConfig()
|
static |
Definition at line 1461 of file main.cc.
References SquidConfig::chroot_dir, Config, ConfigureDebugging(), enter_suid(), IamMasterProcess(), InDaemonMode(), fde::Init(), leave_suid(), mainSetCwd(), RunConfigUsers(), and setMaxFD().
Referenced by SquidMain(), and watch_child().
◆ usage()
|
static |
Definition at line 356 of file main.cc.
References APP_SHORTNAME, CACHE_HTTP_PORT, and CACHE_ICP_PORT.
Referenced by mainHandleCommandLineOption().
◆ watch_child()
|
static |
Definition at line 1905 of file main.cc.
References APP_SHORTNAME, CommandLine::arg0(), assert, SBuf::c_str(), Config, configured_once, Kids::count(), enter_suid(), fatalf(), Kids::find(), RegisteredRunner::finishShutdown(), Kids::get(), getCurrentTime(), Kid::gist(), GoIntoBackground(), SquidConfig::hopelessKidRevivalDelay, Kids::init(), leave_suid(), Debug::log_stderr, mainStartScript(), master_revive_kids(), master_shutdown(), masterCheckAndBroadcastSignals(), masterExit(), masterMaintainKidRevivalSchedule(), masterSignaled(), NULL, O_TEXT, opt_foreground, optKid, pid, Kid::processName(), reconfigure(), CommandLine::resetArg0(), rotate_logs(), RunRegisteredHere, Kid::shouldRestart(), Kids::shouldRestartSome(), shutting_down, sigusr2_handle(), Kids::someRunning(), squid_signal(), Kid::start(), StartUsingConfig(), TexcHere, TheKids, WaitForAnyPid(), SquidConfig::workers, Instance::WriteOurPid(), and xstrerr().
Referenced by SquidMain().
◆ WIN32_svcHandler()
VOID WINAPI WIN32_svcHandler | ( | DWORD | Opcode | ) |
Definition at line 578 of file WinSvc.cc.
References DBG_IMPORTANT, debugs, reconfigure(), rotate_logs(), shut_down(), sigusr2_handle(), svcHandle, and svcStatus.
Referenced by WIN32_Subsystem_Init().
◆ WIN32_svcstatusupdate()
void WIN32_svcstatusupdate | ( | DWORD | svcstate, |
DWORD | WaitHint | ||
) |
Definition at line 567 of file WinSvc.cc.
References svcHandle, and svcStatus.
Referenced by SignalEngine::doShutdown(), SquidMain(), and SquidShutdown().
Variable Documentation
◆ Chrooted
bool Chrooted = false |
Hack: Have we called chroot()? This exposure is needed because some code has to open the same files before and after chroot()
Definition at line 1097 of file main.cc.
Referenced by ConfigureDebugging(), mainSetCwd(), and PidFilenameCalc().
◆ configured_once
|
static |
Definition at line 150 of file main.cc.
Referenced by AvoidSignalAction(), mainInitialize(), SquidMain(), and watch_child().
◆ do_handle_stopped_child
|
static |
Definition at line 159 of file main.cc.
Referenced by SignalEngine::checkEvents(), SignalEngine::handleStoppedChild(), and sig_child().
◆ do_reconfigure
|
static |
Definition at line 154 of file main.cc.
Referenced by SignalEngine::checkEvents(), mainReconfigureStart(), masterCheckAndBroadcastSignals(), masterReconfigureStart(), and reconfigure().
◆ do_revive_kids
|
static |
Definition at line 157 of file main.cc.
Referenced by master_revive_kids(), masterCheckAndBroadcastSignals(), and masterReviveKids().
◆ do_rotate
|
static |
Definition at line 155 of file main.cc.
Referenced by SignalEngine::checkEvents(), mainRotate(), and rotate_logs().
◆ do_shutdown
|
static |
Definition at line 156 of file main.cc.
Referenced by SignalEngine::checkEvents(), SignalEngine::doShutdown(), master_shutdown(), masterCheckAndBroadcastSignals(), masterShutdownStart(), and shut_down().
◆ icpPortNumOverride
|
static |
Definition at line 149 of file main.cc.
Referenced by mainHandleCommandLineOption(), and mainInitialize().
◆ opt_command_line
Definition at line 142 of file main.cc.
Referenced by mainHandleCommandLineOption(), and SquidMain().
◆ opt_install_service
Definition at line 140 of file main.cc.
Referenced by mainHandleCommandLineOption(), and SquidMain().
◆ opt_remove_service
Definition at line 141 of file main.cc.
Referenced by mainHandleCommandLineOption(), and SquidMain().
◆ opt_signal_service
Definition at line 147 of file main.cc.
Referenced by mainHandleCommandLineOption(), and sendSignal().
◆ opt_syslog_facility
|
static |
Definition at line 148 of file main.cc.
Referenced by mainHandleCommandLineOption().
◆ ReconfigureSignal
|
static |
Definition at line 162 of file main.cc.
Referenced by masterCheckAndBroadcastSignals(), masterSignaled(), and reconfigure().
◆ ReviveKidsSignal
|
static |
Definition at line 164 of file main.cc.
Referenced by master_revive_kids(), masterCheckAndBroadcastSignals(), and masterSignaled().
◆ RotateSignal
|
static |
Definition at line 161 of file main.cc.
Referenced by masterCheckAndBroadcastSignals(), masterSignaled(), and rotate_logs().
◆ shortOpStr
|
static |
Definition at line 423 of file main.cc.
Referenced by main(), Ping::TheConfig::parseCommandOpts(), Transport::TheConfig::parseCommandOpts(), and SquidMain().
◆ shutdown_status
|
static |
Definition at line 158 of file main.cc.
Referenced by shut_down(), and SquidShutdown().
◆ ShutdownSignal
|
static |
Definition at line 163 of file main.cc.
Referenced by SignalEngine::doShutdown(), master_shutdown(), masterCheckAndBroadcastSignals(), masterSignaled(), and shut_down().
◆ squid_start_script
|
static |
Definition at line 181 of file main.cc.
Referenced by mainStartScript().
◆ squidOptions
|
static |
Definition at line 423 of file main.cc.
Referenced by SquidMain().