code related to Squid Instance and PID file management
Functions | |
void | ThrowIfAlreadyRunning () |
void | WriteOurPid () |
creates a PID file; throws on error More... | |
pid_t | Other () |
Function Documentation
◆ Other()
pid_t Instance::Other | ( | ) |
- Returns
- another Squid instance PID Throws if PID file maintenance is disabled.
Definition at line 128 of file Instance.cc.
References GetOtherPid(), PidFilename(), FileOpeningConfig::ReadOnly(), and TexcHere.
Referenced by sendSignal().
◆ ThrowIfAlreadyRunning()
void Instance::ThrowIfAlreadyRunning | ( | ) |
Usually throws if another Squid instance is running. False positives are highly unlikely, but the caller must tolerate false negatives well: We may not detect another running instance and, hence, may not throw. Does nothing if PID file maintenance is disabled.
Definition at line 139 of file Instance.cc.
References debugs, File::Optional(), PidFilename(), FileOpeningConfig::ReadOnly(), TheFile, and ThrowIfAlreadyRunningWith().
Referenced by SquidMain().
◆ WriteOurPid()
void Instance::WriteOurPid | ( | ) |
Creates or updates the PID file for the current process. Does nothing if PID file maintenance is disabled.
Definition at line 186 of file Instance.cc.
References debugs, Important, Must, PidFilename(), SBuf::Printf(), FileOpeningConfig::ReadWrite(), RemoveInstance(), File::synchronize(), TheFile, ThePidFileToRemove, ThrowIfAlreadyRunningWith(), File::truncate(), and File::writeAll().
Referenced by SquidMain(), and watch_child().