{"record":{"id":"998739ebbb36ef10","repo":"gravitational/teleport","slug":"pid-files-are-not-supported-on-windows","errorCode":null,"errorMessage":"PID files are not supported on Windows","messagePattern":"PID files are not supported on Windows","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/utils/process/pid_windows.go","lineNumber":28,"sourceCode":" * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage process\n\nimport \"errors\"\n\n// CreateLockedPIDFile creates a PID file in the path specified by pidFile\n// containing the current PID, atomically swapping it in the final place and\n// leaving it with an exclusive advisory lock that will get released when the\n// process ends, for the benefit of \"pkill -L\".\nfunc CreateLockedPIDFile(pidFile string) error {\n\treturn errors.New(\"PID files are not supported on Windows\")\n}\n","sourceCodeStart":10,"sourceCodeEnd":30,"githubUrl":"https://github.com/gravitational/teleport/blob/1283425b60ec5f60d509ba4c791183d452923ff7/lib/utils/process/pid_windows.go#L10-L30","documentation":"CreateLockedPIDFile writes a PID file with an exclusive advisory lock so other tooling can signal or inspect the process. On Windows builds this feature is unimplemented and the function is a stub that always returns this error, so any Teleport service started with PID file logging enabled on Windows will fail at startup.","triggerScenarios":"Calling CreateLockedPIDFile (directly or via service startup code) in a binary compiled for Windows, or running Teleport on Windows with pid_file configured.","commonSituations":"Porting a Linux service config to Windows unchanged; CI/test harnesses that exercise service bootstrap code on Windows; cross-compilation surprises where the pid_windows.go stub is linked in.","solutions":["Remove the pid_file configuration when running on Windows.","Run the service on Linux/macOS where CreateLockedPIDFile is implemented.","If PID tracking is required on Windows, implement process supervision via the Windows service control manager instead."],"exampleFix":"// before (config)\npid_file: /var/run/teleport.pid\n// after (Windows)\n# pid_file omitted — not supported on Windows","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := utils.CreateLockedPIDFile(pidFile); err != nil {\n    if runtime.GOOS == \"windows\" {\n        log.Info(\"PID file not supported on Windows; continuing without it\")\n        return nil\n    }\n    return trace.Wrap(err)\n}","preventionTips":["Gate pid_file configuration on runtime.GOOS.","Do not copy Linux pid_file settings into Windows service configs.","Use the Windows Service Control Manager for process management on Windows."],"tags":["windows","pidfile","platform-limitation"],"backgroundTag":"feature-not-supported-on-platform","analyzedSha":"1283425b60ec5f60d509ba4c791183d452923ff7","analyzedAt":"2026-09-02T04:06:41.601Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}