{"id":20914832,"url":"https://github.com/makifdb/pidfile","last_synced_at":"2026-05-26T17:33:07.501Z","repository":{"id":219527538,"uuid":"724896144","full_name":"makifdb/pidfile","owner":"makifdb","description":"A Go package for single-instance execution via PID file management","archived":false,"fork":false,"pushed_at":"2023-11-29T02:27:11.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T06:48:11.897Z","etag":null,"topics":["go","golang","pid","pid-control"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makifdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-29T02:24:22.000Z","updated_at":"2024-11-09T23:35:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"e907c5ce-26b1-4edc-a34b-3190ec058f26","html_url":"https://github.com/makifdb/pidfile","commit_stats":null,"previous_names":["makifdb/pidfile"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/makifdb/pidfile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makifdb%2Fpidfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makifdb%2Fpidfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makifdb%2Fpidfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makifdb%2Fpidfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makifdb","download_url":"https://codeload.github.com/makifdb/pidfile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makifdb%2Fpidfile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33532141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","pid","pid-control"],"created_at":"2024-11-18T16:11:15.166Z","updated_at":"2026-05-26T17:33:07.485Z","avatar_url":"https://github.com/makifdb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PIDFile Package for Go\n\nThe `pidfile` package provides a simple way to ensure that only one instance of a Go application runs at any given time by using PID (Process ID) files.\n\n## Features\n\n- Easy creation and management of a PID file.\n- Checks if an application is already running.\n- Prevents multiple instances of the application from running concurrently.\n\n## Installation\n\nTo install the `pidfile` package, use the following `go get` command:\n\n```sh\ngo get github.com/makifdb/pidfile\n```\n\n## Example\nHere is a full example of an application that uses the pidfile package to ensure single instance execution\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"os\"\n    \"github.com/makifdb/pidfile\"\n)\n\nfunc main() {\n    // Define the PID file path\n    pidFilePath := filepath.Join(os.TempDir(), \"example.pid\")\n\n    // Create or update the PID file\n    err := pidfile.CreateOrUpdatePIDFile(pidFilePath)\n    if err != nil {\n        log.Fatalf(\"Unable to create or update PID file: %v\", err)\n    }\n    \n    // Defer the removal of the PID file on application exit\n    defer os.Remove(pidFilePath)\n    \n    // Your application logic goes here\n    fmt.Println(\"Application started successfully.\")\n\n    // Application logic...\n}\n```\n\n## Notes\nThis package assumes that the PID file is stored in a location that is writable by the application.\nMake sure to handle the PID file correctly to prevent orphaned PID files, which could prevent the application from starting.\n\n## License\nThis pidfile package is open-source software licensed under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakifdb%2Fpidfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakifdb%2Fpidfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakifdb%2Fpidfile/lists"}