Documentation
¶
Overview ¶
Package process handles stopping running KubeSolo processes and releasing the ports and file handles they hold before a fresh installation begins. All detection is performed by reading /proc directly — no external tools (lsof, ss, netstat) are required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KubeSoloPorts = []int{2379, 6443, 10443, 6060}
KubeSoloPorts are the TCP ports KubeSolo opens; processes holding any of these are candidates for termination if they are a KubeSolo process.
Functions ¶
func CleanupFileConflicts ¶
func CleanupFileConflicts(dataPath string)
CleanupFileConflicts removes socket files and stale PID files left behind by a previous KubeSolo installation so they do not block the new binary.
func StopAll ¶
func StopAll(initBinary string)
StopAll gracefully stops all running KubeSolo processes: first via the installed service manager (if available), then by PID. After SIGTERM it waits up to ~15 s before sending SIGKILL, and then checks port holders.
func StopByExecutablePath ¶
func StopByExecutablePath()
StopByExecutablePath finds all processes whose /proc/<pid>/exe resolves to the KubeSolo binary path and sends SIGTERM. After a grace period it sends SIGKILL to any survivors. The current process is never signalled.
func StopPortHolders ¶
func StopPortHolders()
StopPortHolders finds processes that hold any KubeSolo port and, if they are confirmed to be KubeSolo processes (by /proc/<pid>/exe), terminates them. Non-KubeSolo processes on the same ports are logged but not touched.
func StopViaInitSystem ¶
func StopViaInitSystem(initBinary string)
StopViaInitSystem asks the detected init system to stop the KubeSolo service before resorting to raw process signals. initBinary is the full path to the init system's control command (e.g. "/bin/systemctl") or empty if unknown.
func StopWorkloads ¶ added in v1.2.1
func StopWorkloads()
StopWorkloads terminates every container process and every shim still running once the KubeSolo service has stopped.
Pods run under kubepods and their shims in the service cgroup, so KillMode=process leaves both alive when the service stops. Reset and uninstall call this before deleting the data directory; restart and upgrade must not, since they reattach to the workloads instead.
Only call it once the service is stopped: anything left in its cgroup is an orphan.
Types ¶
This section is empty.