{"id":23055170,"url":"https://github.com/tomenz/srvlib","last_synced_at":"2025-06-24T08:02:35.175Z","repository":{"id":39145210,"uuid":"296059745","full_name":"Tomenz/SrvLib","owner":"Tomenz","description":"A plugin library to make your console application a windows system service, or a Linux daemon service","archived":false,"fork":false,"pushed_at":"2024-11-13T12:41:12.000Z","size":91,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T08:22:24.657Z","etag":null,"topics":["cpp-library","cpp11","daemon","daemonize","library","linux-daemon","service","systemd","windows","windows-service"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Tomenz.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":"2020-09-16T14:37:36.000Z","updated_at":"2024-11-13T12:41:16.000Z","dependencies_parsed_at":"2024-11-13T13:36:42.838Z","dependency_job_id":"6e9b4d1e-e0bb-4400-8d11-113e389c41f7","html_url":"https://github.com/Tomenz/SrvLib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Tomenz/SrvLib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tomenz%2FSrvLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tomenz%2FSrvLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tomenz%2FSrvLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tomenz%2FSrvLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tomenz","download_url":"https://codeload.github.com/Tomenz/SrvLib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tomenz%2FSrvLib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261632033,"owners_count":23187268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cpp-library","cpp11","daemon","daemonize","library","linux-daemon","service","systemd","windows","windows-service"],"created_at":"2024-12-16T01:11:15.123Z","updated_at":"2025-06-24T08:02:35.144Z","avatar_url":"https://github.com/Tomenz.png","language":"C++","readme":"# SrvLib\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/73915c0f4be040198b0ebdd0466f34b9)](https://app.codacy.com/gh/Tomenz/SrvLib?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=Tomenz/SrvLib\u0026utm_campaign=Badge_Grade)\n[![Build status](https://ci.appveyor.com/api/projects/status/871d8ynr5qwu589h?svg=true)](https://ci.appveyor.com/project/Tomenz/srvlib)\n[![CodeQL](https://github.com/Tomenz/SrvLib/actions/workflows/codeql.yml/badge.svg)](https://github.com/Tomenz/SrvLib/actions/workflows/codeql.yml)\n[![CMake](https://github.com/Tomenz/SrvLib/actions/workflows/cmake.yml/badge.svg)](https://github.com/Tomenz/SrvLib/actions/workflows/cmake.yml)\n\nA plugin library to make your console application a windows system service, or a linux daemon service\n\n# Windows\nOn Windows there are commandline option to install,remove,start and stop the service.\n\n    -i   Install the system service\n    -r   Removes the system service\n    -s   Starts the system service\n    -e   Shuts down the system service\n    -p   System service is paused (pause)\n    -c   System service will continue (Continue)\n    -f   Start the application as a console application\n    -k   Reload configuration\n    -h   Show this help\n\n# Linux - systemd\n\n    Rename an copy the example.service file after editing to /etc/systemd/system/\n    Reload the systemd as root with: systemctl daemon-reload\n    \n    IN THE NEXT COMMANDS USE THE NAME OF THE RENAMED \"example\" FILE!\n    \n    Enable the auto start run this command as root: systemctl enable example.service\n    To start the service, run as root: systemctl start example.service\n    To stop the service, run as root: systemctl stop example.service\n    To reload the what ever, run as root: systemctl reload example.service\n\n# Linux - init.d\nCopy the file in the init.d directory to /etc/init.d/ and rename it, modify the execution rights, and change the application name and the path for the application in that file.\n\ncommanline option are:\n/etc/init.d/filename start|stop|status|restart|reload|install|remove\n\n# Example\n```\n#include \"Service.h\"\n\nint main(int argc, const char* argv[])\n{\n    SrvParam svParam;\n#if defined(_WIN32) || defined(_WIN64)\n    svParam.szDspName = L\"Example Service\";                 // Servicename in Service control manager of windows\n    svParam.szDescrip = L\"Example Service by your name\";    // Description in Service control manager of windows\n#endif\n    svParam.szSrvName = L\"ExampleServ\";                     // Service name (service id)\n    svParam.fnStartCallBack = []()\n    {   // Start you server here\n    };\n    svParam.fnStopCallBack = []() \n    {   // Stop you server here\n    };\n    svParam.fnSignalCallBack = []()\n    {   // what ever you do with this callback, maybe reload the configuration\n    };\n\n    return ServiceMain(argc, argv, svParam);\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomenz%2Fsrvlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomenz%2Fsrvlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomenz%2Fsrvlib/lists"}