{"id":46484868,"url":"https://github.com/leprosus/golang-daemon","last_synced_at":"2026-03-06T09:12:08.535Z","repository":{"id":57521195,"uuid":"90602734","full_name":"leprosus/golang-daemon","owner":"leprosus","description":"Golang package to daemonize","archived":false,"fork":false,"pushed_at":"2022-01-02T16:08:35.000Z","size":23,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T23:12:09.875Z","etag":null,"topics":["daemon","daemonize","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leprosus.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-08T08:11:38.000Z","updated_at":"2024-06-19T23:12:09.876Z","dependencies_parsed_at":"2022-09-26T18:01:15.411Z","dependency_job_id":null,"html_url":"https://github.com/leprosus/golang-daemon","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/leprosus/golang-daemon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leprosus%2Fgolang-daemon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leprosus%2Fgolang-daemon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leprosus%2Fgolang-daemon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leprosus%2Fgolang-daemon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leprosus","download_url":"https://codeload.github.com/leprosus/golang-daemon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leprosus%2Fgolang-daemon/sbom","scorecard":{"id":585448,"data":{"date":"2025-08-18","repo":{"name":"github.com/leprosus/golang-daemon","commit":"c7354fc412af1a3d5a0782756bc23532c705cd3b"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: License.md:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: License.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T20:22:46.543Z","repository_id":57521195,"created_at":"2025-08-20T20:22:46.543Z","updated_at":"2025-08-20T20:22:46.543Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30168646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["daemon","daemonize","golang"],"created_at":"2026-03-06T09:12:07.987Z","updated_at":"2026-03-06T09:12:08.521Z","avatar_url":"https://github.com/leprosus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang package to daemonize server application\n\n## Create new daemon\n\n```go\nfunc main(){\n    if len(os.Args) \u003c 2 {\n        return\n    }\n\n    err := daemon.Init(os.Args[0], map[string]interface{}{}, \"./app.pid\")\n    if err != nil {\n        return\n    }\n\n    var cmd string\n    if len(os.Args) \u003e 1 {\n        cmd = os.Args[1]\n    }\n    \n    switch cmd {\n    case \"start\":\n        err = daemon.Start()\n    case \"stop\":\n        err = daemon.Stop()\n    case \"restart\":\n        err = daemon.Stop()\n        err = daemon.Start()\n    case \"status\":\n        status := \"stopped\"\n        if daemon.IsRun() {\n            status = \"started\"\n        }\n    \n        fmt.Printf(\"Application is %s\\n\", status)\n    \n        return\n    case \"\":\n\t\tfallthrough\n    default:\n        mainLoop()\n    }\n}\n\nfunc mainLoop(){\n    for {\n        log.Println(\"I'm daemon\")\n        time.Sleep(time.Minute)\n    }\n}\n```\n\nTo start the script as daemon to need:\n\n`$ go build -o daemon.app`\n\n`$ ./daemon.app start`\n\nTo stop:\n\n`$ ./daemon.app stop`\n\nTo restart:\n\n`$ ./daemon.app restart`\n\nTo show status:\n\n`$ ./daemon.app status`\n\nYou may see the code in this [example](./example/deamon.go).\n\n## Create new daemon with full code control\n\nIn the case to start to need just compile code and run as usual:\n`$ go build -o daemon.app`\n`$ ./daemon.app`\n\nNB The script starts as daemon from beginning and will be stopped after 1 minute.\n\n## List all methods\n\n* daemon.Init - initializes daemon\n* daemon.Start - to daemonize script\n* daemon.Stop - to stop of daemonization\n* daemon.IsRun - returns flag of the running\n* daemon.RemovePIDFile() - removes autocreated PID file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleprosus%2Fgolang-daemon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleprosus%2Fgolang-daemon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleprosus%2Fgolang-daemon/lists"}