#include "squid.h"
#include "AccessLogEntry.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 "client_db.h"
#include "client_side.h"
#include "comm.h"
#include "CommandLine.h"
#include "compat/unistd.h"
#include "ConfigParser.h"
#include "CpuAffinity.h"
#include "debug/Messages.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 "http/Stream.h"
#include "HttpHeader.h"
#include "HttpReply.h"
#include "icmp/IcmpSquid.h"
#include "icmp/net_db.h"
#include "ICP.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 "PeerSelectState.h"
#include "protos.h"
#include "redirect.h"
#include "refresh.h"
#include "sbuf/Stream.h"
#include "SBufStatsAction.h"
#include "SquidConfig.h"
#include "stat.h"
#include "StatCounters.h"
#include "Store.h"
#include "store/Disks.h"
#include "store_log.h"
#include "StoreFileSystem.h"
#include "time/Engine.h"
#include "tools.h"
#include "unlinkd.h"
#include "windows_service.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 <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) |
static void | master_revive_kids (int sig) |
static void | master_shutdown (int sig) |
Shutdown signal handler for master process. More... | |
void | shut_down (int sig) |
void | sig_child (int sig) |
static SBuf | ConfigurationFailureMessage () |
error message to log when Configuration::Parse() fails More... | |
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 () |
Start directing debugs() messages to the configured cache.log. More... | |
static void | RunConfigUsers () |
static void | StartUsingConfig () |
static void | RegisterModules () |
register all known modules for handling future RegisteredRunner events More... | |
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 = nullptr |
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 232 of file main.cc.
References configured_once, DBG_IMPORTANT, debugs, reconfiguring, and shutting_down.
Referenced by SignalEngine::doShutdown(), mainReconfigureStart(), mainRotate(), masterReconfigureStart(), masterReviveKids(), and masterShutdownStart().
◆ ConfigurationFailureMessage()
|
static |
Definition at line 834 of file main.cc.
References SBufStream::buf(), CurrentException(), Debug::Extra(), opt_parse_cfg_only, and reconfiguring.
Referenced by mainReconfigureFinish(), and SquidMain().
◆ ConfigureCurrentKid()
|
static |
Definition at line 1286 of file main.cc.
References APP_SHORTNAME, SBuf::assign(), SBuf::c_str(), SBuf::cmp(), CharacterSet::DIGIT, CommandLine::hasOption(), KidIdentifier, Debug::NameThisKid(), optKid, pkCoordinator, pkDisker, pkOther, pkWorker, TheKidName, TheProcessKind, and xatoi().
Referenced by SquidMain().
◆ ConfigureDebugging()
|
static |
Definition at line 1314 of file main.cc.
References Debug::BanCacheLogUse(), SquidConfig::chroot_dir, Chrooted, Config, FD_LOG, fd_open(), opt_no_daemon, and Debug::UseCacheLog().
Referenced by StartUsingConfig().
◆ GoIntoBackground()
|
static |
Definition at line 1799 of file main.cc.
References Debug::ForgetSaved(), Must, pid, TexcHere, ToSBuf(), and xstrerr().
Referenced by watch_child().
◆ main()
Definition at line 1253 of file main.cc.
References opt_no_daemon, SquidMainSafe(), and WIN32_StartService().
◆ mainChangeDir()
|
static |
Definition at line 991 of file main.cc.
References DBG_CRITICAL, debugs, and xstrerr().
Referenced by mainSetCwd().
◆ mainHandleCommandLineOption()
|
static |
- C
- Unset/disable 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
- debugs() messages with the given debugging level (and the more important ones) should be written to stderr
- 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
- Request cache_dir initialization
- –foreground
- Set global option opt_foreground
- h,?, or unknown
Definition at line 401 of file main.cc.
References add_http_port(), CharacterSet::ALPHA, Debug::BanCacheLogUse(), ConfigFile, Debug::ConfigureSyslog(), DBG_CRITICAL, DBG_IMPORTANT, debugs, CharacterSet::DIGIT, Debug::EnsureDefaultStderrLevel(), fatal(), fatalf(), icpPortNumOverride, SBuf::length(), 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, Debug::ResetStderrLevel(), service_name, sigusr2_handle(), SQUIDSBUFPH, SQUIDSBUFPRINT, TRUE, usage(), version_string, xatoi(), xfree, and xstrdup.
Referenced by SquidMain().
◆ mainInitialize()
|
static |
Definition at line 1040 of file main.cc.
References accessLogInit(), authenticateInit(), SquidConfig::chroot_dir, Mem::CleanIdlePools(), SquidConfig::ClientDelay, Config, configured_once, Critical, 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(), icapLogOpen(), SquidConfig::icp, icpPortNumOverride, Important, Dns::Init(), Ssl::Helper::Init(), DelayPools::Init(), Ssl::CertValidationHelper::Init(), FwdState::initModule(), ipcache_init(), ipcache_purgelru(), SquidConfig::loadable_module_names, LoadableModulesConfigure(), mainSetCwd(), Store::Maintain(), mimeInit(), SquidConfig::mimeTablePathname, neighbors_init(), no_suid(), Adaptation::Config::onoff, Security::OpenLogs(), opt_catch_signals, parseEtcHosts(), SquidConfig::Port, ProcessRoles(), reconfigure(), redirectInit(), refreshInit(), SBufStatsAction::RegisterWithCacheManager(), AsyncJob::RegisterWithCacheManager(), rotate_logs(), SA_NODEFER, SA_RESETHAND, SA_RESTART, serverConnectionsOpen(), service_name, setEffectiveUser(), setSystemLimits(), shut_down(), sig_child(), sigusr2_handle(), Squid_MaxFD, squid_signal(), statInit(), storeInit(), Auth::TheConfig, Adaptation::Icap::TheConfig, Adaptation::Ecap::TheConfig, unlinkdInit(), unlinkdNeeded(), urlInitialize(), version_string, and WIN32_IpAddrChangeMonitorInit().
Referenced by SquidMain().
◆ mainReconfigureFinish()
|
static |
Definition at line 845 of file main.cc.
References accessLogInit(), authenticateInit(), SquidConfig::ClientDelay, Config, Config2, ConfigurationFailureMessage(), CpuAffinityCheck(), CpuAffinityReconfigure(), DBG_CRITICAL, debugs, SquidConfig2::enable_purge, enter_suid(), errorClean(), errorInitialize(), externalAclInit(), fatal(), 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(), Adaptation::Config::onoff, SquidConfig2::onoff, Security::OpenLogs(), Configuration::Parse(), parseEtcHosts(), Ssl::Helper::Reconfigure(), Ssl::CertValidationHelper::Reconfigure(), reconfiguring, redirectReconfigure(), RunRegisteredHere, serverConnectionsOpen(), setEffectiveUser(), setUmask(), storeDirOpenSwapLogs(), storeLogOpen(), RegisteredRunner::syncConfig(), Auth::TheConfig, Adaptation::Icap::TheConfig, Adaptation::Ecap::TheConfig, SquidConfig::umask, unlinkdInit(), unlinkdNeeded(), Debug::UseCacheLog(), and SquidConfig::workers.
Referenced by mainReconfigureStart().
◆ mainReconfigureStart()
|
static |
Definition at line 800 of file main.cc.
References accessLogClose(), authenticateReset(), AvoidSignalAction(), Security::CloseLogs(), DBG_IMPORTANT, debugs, do_reconfigure, eventAdd(), externalAclShutdown(), icapLogClose(), icpClosePorts(), mainReconfigureFinish(), Ssl::GlobalContextStorage::reconfigureStart(), reconfiguring, RunRegisteredHere, serverConnectionsClose(), RegisteredRunner::startReconfigure(), storeDirCloseSwapLogs(), storeLogClose(), Ssl::TheGlobalContextStorage(), and version_string.
Referenced by SignalEngine::checkEvents().
◆ mainRotate()
|
static |
Definition at line 942 of file main.cc.
References _db_rotate_log(), accessLogRotate(), authenticateInit(), authenticateRotate(), AvoidSignalAction(), IcmpSquid::Close(), do_rotate, externalAclInit(), externalAclShutdown(), icapLogRotate(), icmpEngine, IcmpSquid::Open(), redirectInit(), redirectShutdown(), Security::RotateLogs(), storeDirWriteCleanLogs(), storeLogRotate(), and Auth::TheConfig.
Referenced by SignalEngine::checkEvents().
◆ mainSetCwd()
|
static |
Definition at line 1008 of file main.cc.
References SquidConfig::chroot_dir, Chrooted, Config, SquidConfig::coredump_dir, DBG_CRITICAL, DBG_IMPORTANT, debugs, fatalf(), Important, mainChangeDir(), MAXPATHLEN, and xstrerr().
Referenced by mainInitialize(), SquidMain(), and StartUsingConfig().
◆ mainStartScript()
|
static |
Definition at line 1688 of file main.cc.
References MAXPATHLEN, squid_start_script, WaitForOnePid(), and xstrncpy().
Referenced by watch_child().
◆ master_revive_kids()
|
static |
Definition at line 719 of file main.cc.
References do_revive_kids, and ReviveKidsSignal.
Referenced by watch_child().
◆ master_shutdown()
|
static |
Definition at line 733 of file main.cc.
References do_shutdown, and ShutdownSignal.
Referenced by watch_child().
◆ masterCheckAndBroadcastSignals()
|
static |
Definition at line 1758 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 1817 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 1781 of file main.cc.
References assert, debugs, Kids::forgetOldFailures(), and TheKids.
Referenced by watch_child().
◆ masterReconfigureFinish()
|
static |
Definition at line 1741 of file main.cc.
References reconfiguring.
Referenced by masterCheckAndBroadcastSignals().
◆ masterReconfigureStart()
|
static |
Definition at line 1728 of file main.cc.
References AvoidSignalAction(), debugs, do_reconfigure, Kids::forgetAllFailures(), reconfiguring, and TheKids.
Referenced by masterCheckAndBroadcastSignals().
◆ masterReviveKids()
|
static |
Definition at line 1748 of file main.cc.
References AvoidSignalAction(), Config, debugs, do_revive_kids, and SquidConfig::hopelessKidRevivalDelay.
Referenced by masterCheckAndBroadcastSignals().
◆ masterShutdownStart()
|
static |
Definition at line 1718 of file main.cc.
References AvoidSignalAction(), debugs, do_shutdown, and shutting_down.
Referenced by masterCheckAndBroadcastSignals().
◆ masterSignaled()
|
inlinestatic |
Definition at line 1791 of file main.cc.
References DebugSignal, ReconfigureSignal, ReviveKidsSignal, RotateSignal, and ShutdownSignal.
Referenced by watch_child().
◆ OnTerminate()
|
static |
Definition at line 1224 of file main.cc.
References CurrentExceptionExtra(), DBG_CRITICAL, debugs, and Debug::PrepareToDie().
Referenced by SquidMainSafe().
◆ reconfigure()
void reconfigure | ( | int | sig | ) |
Definition at line 706 of file main.cc.
References do_reconfigure, reconfigure(), and ReconfigureSignal.
Referenced by Mgr::ReconfigureAction::dump(), mainInitialize(), reconfigure(), watch_child(), WIN32_IpAddrChangeMonitor(), and WIN32_svcHandler().
◆ RegisterModules()
|
static |
Definition at line 1366 of file main.cc.
References CallRunnerRegistrator, and CallRunnerRegistratorIn.
Referenced by SquidMain().
◆ rotate_logs()
void rotate_logs | ( | int | sig | ) |
Definition at line 692 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 1330 of file main.cc.
References RegisteredRunner::claimMemoryNeeds(), RunRegisteredHere, and RegisteredRunner::useConfig().
Referenced by StartUsingConfig().
◆ sendSignal()
|
static |
Definition at line 1658 of file main.cc.
References opt_send_signal, opt_signal_service, Instance::Other(), pid, TexcHere, ToSBuf(), WIN32_sendSignal(), and xstrerr().
Referenced by SquidMain().
◆ serverConnectionsClose()
|
static |
Definition at line 788 of file main.cc.
References assert, clientConnectionsClose(), IcmpSquid::Close(), IamWorkerProcess(), icmpEngine, icpConnectionShutdown(), reconfiguring, and shutting_down.
Referenced by SignalEngine::doShutdown(), and mainReconfigureStart().
◆ serverConnectionsOpen()
|
static |
Definition at line 774 of file main.cc.
References clientOpenListenSockets(), IamWorkerProcess(), icmpEngine, icpOpenPorts(), Acl::Node::Initialize(), netdbInit(), IcmpSquid::Open(), and peerSelectInit().
Referenced by mainInitialize(), and mainReconfigureFinish().
◆ setEffectiveUser()
|
static |
Definition at line 971 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 747 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 762 of file main.cc.
References do_handle_stopped_child, and sig_child().
Referenced by mainInitialize(), and sig_child().
◆ SquidMain()
Definition at line 1420 of file main.cc.
References assert, RegisteredRunner::bootstrapConfig(), SquidConfig::chroot_dir, comm_init(), Config, ConfigFile, ConfigurationFailureMessage(), ConfigureCurrentKid(), configured_once, CpuAffinityCheck(), CpuAffinityInit(), Store::Controller::create(), current_time, DBG_CRITICAL, debugs, enter_suid(), EventLoop::errcount, failure_notify, fatal(), fatal_dump(), RegisteredRunner::finalizeConfig(), CommandLine::forEachOption(), getCurrentTime(), EventScheduler::GetInstance(), IamCoordinatorProcess(), IamDiskProcess(), IamMasterProcess(), IamPrimaryProcess(), IamWorkerProcess(), InDaemonMode(), Fs::Init(), Auth::Init(), Mem::Init(), Acl::Init(), Format::Token::Init(), AnyP::UriScheme::Init(), Ipc::Coordinator::Instance(), leave_suid(), mainHandleCommandLineOption(), mainInitialize(), mainSetCwd(), no_suid(), 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, Configuration::Parse(), Ip::ProbeTransport(), EventLoop::registerEngine(), RegisterModules(), Store::Root(), EventLoop::run(), RunRegisteredHere, sendSignal(), setEffectiveUser(), EventLoop::setPrimaryEngine(), EventLoop::setTimeService(), Debug::SettleStderr(), Debug::SettleSyslog(), setUmask(), 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 1269 of file main.cc.
References CurrentException(), DBG_CRITICAL, debugs, OnTerminate(), and SquidMain().
Referenced by main(), and SquidWinSvcMain().
◆ SquidShutdown()
|
static |
Definition at line 1997 of file main.cc.
References accessLogClose(), authenticateReset(), comm_exit(), commCloseAllSockets(), debugs, dumpMallocStats(), externalAclShutdown(), fdDumpOpen(), RegisteredRunner::finishShutdown(), DiskIOModule::FreeAllModules(), DelayPools::FreePools(), Adaptation::Config::freeService(), icpClosePorts(), Important, memClean(), PrintRusage(), redirectShutdown(), releaseServerSockets(), Store::Root(), RunRegisteredHere, Ssl::Helper::Shutdown(), Ssl::CertValidationHelper::Shutdown(), shutdown_status, storeDirWriteCleanLogs(), storeLogClose(), Store::Controller::sync(), Adaptation::Icap::TheConfig, unlinkdClose(), version_string, and WIN32_svcstatusupdate().
Referenced by SquidMain().
◆ SquidWinSvcMain()
void WINAPI SquidWinSvcMain | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 1246 of file main.cc.
References SquidMainSafe().
◆ StartUsingConfig()
|
static |
Definition at line 1337 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 316 of file main.cc.
References APP_SHORTNAME, CACHE_HTTP_PORT, and CACHE_ICP_PORT.
Referenced by mainHandleCommandLineOption().
◆ watch_child()
|
static |
Definition at line 1835 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(), mainStartScript(), master_revive_kids(), master_shutdown(), masterCheckAndBroadcastSignals(), masterExit(), masterMaintainKidRevivalSchedule(), masterSignaled(), 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(), Debug::StderrEnabled(), TexcHere, TheKids, WaitForAnyPid(), SquidConfig::workers, Instance::WriteOurPid(), xopen(), and xstrerr().
Referenced by SquidMain().
◆ WIN32_svcHandler()
VOID WINAPI WIN32_svcHandler | ( | DWORD | Opcode | ) |
Definition at line 578 of file windows_service.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 windows_service.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 1004 of file main.cc.
Referenced by ConfigureDebugging(), mainSetCwd(), and PidFilenameCalc().
◆ configured_once
|
static |
Definition at line 137 of file main.cc.
Referenced by AvoidSignalAction(), mainInitialize(), SquidMain(), and watch_child().
◆ do_handle_stopped_child
|
static |
Definition at line 146 of file main.cc.
Referenced by SignalEngine::checkEvents(), SignalEngine::handleStoppedChild(), and sig_child().
◆ do_reconfigure
|
static |
Definition at line 141 of file main.cc.
Referenced by SignalEngine::checkEvents(), mainReconfigureStart(), masterCheckAndBroadcastSignals(), masterReconfigureStart(), and reconfigure().
◆ do_revive_kids
|
static |
Definition at line 144 of file main.cc.
Referenced by master_revive_kids(), masterCheckAndBroadcastSignals(), and masterReviveKids().
◆ do_rotate
|
static |
Definition at line 142 of file main.cc.
Referenced by SignalEngine::checkEvents(), mainRotate(), and rotate_logs().
◆ do_shutdown
|
static |
Definition at line 143 of file main.cc.
Referenced by SignalEngine::checkEvents(), SignalEngine::doShutdown(), master_shutdown(), masterCheckAndBroadcastSignals(), masterShutdownStart(), and shut_down().
◆ icpPortNumOverride
|
static |
Definition at line 136 of file main.cc.
Referenced by mainHandleCommandLineOption(), and mainInitialize().
◆ opt_command_line
Definition at line 129 of file main.cc.
Referenced by mainHandleCommandLineOption(), and SquidMain().
◆ opt_install_service
Definition at line 127 of file main.cc.
Referenced by mainHandleCommandLineOption(), and SquidMain().
◆ opt_remove_service
Definition at line 128 of file main.cc.
Referenced by mainHandleCommandLineOption(), and SquidMain().
◆ opt_signal_service
Definition at line 134 of file main.cc.
Referenced by mainHandleCommandLineOption(), and sendSignal().
◆ opt_syslog_facility
|
static |
Definition at line 135 of file main.cc.
Referenced by mainHandleCommandLineOption().
◆ ReconfigureSignal
|
static |
Definition at line 149 of file main.cc.
Referenced by masterCheckAndBroadcastSignals(), masterSignaled(), and reconfigure().
◆ ReviveKidsSignal
|
static |
Definition at line 151 of file main.cc.
Referenced by master_revive_kids(), masterCheckAndBroadcastSignals(), and masterSignaled().
◆ RotateSignal
|
static |
Definition at line 148 of file main.cc.
Referenced by masterCheckAndBroadcastSignals(), masterSignaled(), and rotate_logs().
◆ shortOpStr
|
static |
Definition at line 384 of file main.cc.
Referenced by SquidMain().
◆ shutdown_status
|
static |
Definition at line 145 of file main.cc.
Referenced by shut_down(), and SquidShutdown().
◆ ShutdownSignal
|
static |
Definition at line 150 of file main.cc.
Referenced by master_shutdown(), masterCheckAndBroadcastSignals(), masterSignaled(), and shut_down().
◆ squid_start_script
|
static |
Definition at line 168 of file main.cc.
Referenced by mainStartScript().
◆ squidOptions
|
static |
Definition at line 391 of file main.cc.
Referenced by SquidMain().
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