{"id":18362362,"url":"https://github.com/srenatus/cookbook-service_factory","last_synced_at":"2026-07-13T02:32:12.380Z","repository":{"id":152433972,"uuid":"11950022","full_name":"srenatus/cookbook-service_factory","owner":"srenatus","description":"Chef Cookbook","archived":false,"fork":false,"pushed_at":"2013-08-08T07:19:28.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-21T18:35:57.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://community.opscode.com/cookbooks/service_factory","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srenatus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-07T12:59:40.000Z","updated_at":"2014-11-06T02:37:08.000Z","dependencies_parsed_at":"2023-04-10T17:34:44.111Z","dependency_job_id":null,"html_url":"https://github.com/srenatus/cookbook-service_factory","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/srenatus/cookbook-service_factory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srenatus%2Fcookbook-service_factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srenatus%2Fcookbook-service_factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srenatus%2Fcookbook-service_factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srenatus%2Fcookbook-service_factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srenatus","download_url":"https://codeload.github.com/srenatus/cookbook-service_factory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srenatus%2Fcookbook-service_factory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35408466,"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":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-05T22:40:34.985Z","updated_at":"2026-07-13T02:32:12.363Z","avatar_url":"https://github.com/srenatus.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# service_factory cookbook\n\nCookbook for Opscode Chef.\n\nhttp://community.opscode.com/cookbooks/service_factory\n\n**Fully functional … documentation WIP, and example usages coming soon !!**\n\n\n# Description\n\nGenerate services using native system features with the **service_factory** LWRPs.\n\nYour recipe provides the configuration details, and the necessary files are generated to create a **SysV** or **Upstart** service, depending on what each OS prefers. (**SystemD** coming soon!!)\n\n**Supported Service Managers**\n\n- SysV (init.d, chkconfig, etc.)\n- Upstart (Ubuntu, Debian, etc.)\n\n**Supported Operating Systems**\nThe following are supported and verified through test-kitchen automated integration testing.\n\n- Centos\n- Ubuntu\n\n**Default Service Managers**\n\nUnless otherwise specified in the **service_factory** global config, the default service manager is **SysV**, and\nothers are selected conditionally based on the distribution and version.\n\nYou can customize these defaults by adjusting the 'platform_map' node attribute, described below.\n\n\n# Requirements\n\nCookbooks:: [unix_bin](http://community.opscode.com/cookbooks/service_factory) , [resource_masher](http://community.opscode.com/cookbooks/resource_masher) , [run_action_now](http://community.opscode.com/cookbooks/run_action_now)\n\nResource attributes:: `service_desc` , `exec` , `run_user` , `run_group`\n\n\n# Resource Documentation\n\n**RESOURCE ACTIONS**\n\n```\n:create , :delete , :start , :stop , :restart , :enable , :disable\n```\n\n**Note:** You can also use a standard Chef service resource to manage the service once created.\n\n**RESOURCE ATTRIBUTES**\n\n```\n:attribute       = default\n    description (type)\n```\n\n    :service_name\n        Simple name of service. Defaults to resource name. (/^[a-z0-9_]+$/i)\n\n    :service_desc\n        Short description of service. (Required)\n\n    :run_user\n        Name or id of user to run service under. (Required)\n\n    :run_group\n        Name or id of group to run service under. (Required)\n\n    :exec\n        Full path to executable binary. (Required)\n\n    :exec_args      = \"\"\n        Command line args to executable. (String or Array)\n\n    :exec_umask     = \"0027\"\n        umask set before execution\n\n    :exec_forks     = false\n        Does executable fork at startup? (Important)\n\n    :process_name   = basename %{exec}\n        Used to detect status and stop service.\n\n    :kill_timeout   = 5\n        Number of seconds to wait before killing at stop/shutdown.\n\n    :before_start   = \"\"\n        Shell commands to run before starting service.\n\n    :after_start    = \"\"\n        Shell commands to run after starting service.\n\n    :before_stop    = \"\"\n        Shell commands to run before stopping service.\n\n    :after_stop     = \"\"\n        Shell commands to run after stopping service.\n\n    :base_path      = \"\"\n        Prefix to FHS paths.\n        Ex. \"/srv/myapp\" =\u003e \"/srv/myapp/etc/\"\n\n    :var_subpath    = ( %{run_user} == 'root'  ?  %{run_group}  :  %{service_name} )\n        Suffix added to var directories.\n        Ex. \"myapp\" =\u003e \"/var/run/myapp/appname.pid\"\n\n    :lock_file      = %{base_path}/var/lock/subsys/%{service_name}\n        Full path to lock file.\n\n    :log_file       = %{base_path}/var/log/%{var_subpath}/%{service_name}.log\n        Full path to log file.\n\n    :log_what       = :none\n        What service output should be logged. (:std_out  :std_err  :std_all  :none)\n\n    :pid_file {base_path}/var/run/{var_subpath}/{service_name}.pid\n        Full path to pid file.\n\n    :create_pid     = %{exec_forks}  ?  false  :  true\n        If true the factory creates a pid file, otherwise the daemon should create it.\n\n    :path_variables = Hash.new\n        Additional variables injectable into path strings.\n\n\n# Recipes\n\nThis cookbook only provides LWRPs, no recipes are included.\n\n\n# Attributes\n\nThe following default node attributes govern the platform selection.\nYou may customize the operation by appending/overwriting these in your node configuration.\n\n```\ndefault[\"service_factory\"][\"platform_map\"][\"default\"] = \"init\"\ndefault[\"service_factory\"][\"platform_map\"][\"ubuntu\"][\"default\"] = \"upstart\"\n```\n\n\n# Test-Kitchen\n\nThis package is **test-kitchen** enabled and automatically tested against:\n\n- CentOS 5 and 6\n- Ubuntu 10 and 12\n\nA successful test appears as follows:\n\n```\n-----\u003e Running bats test suite\n       1..6\n       ok 1 non-forked service\n       ok 2 forked service\n       ok 3 sighup restart (non-forked)\n       ok 4 sighup restart (forked)\n       ok 5 nobody service\n       ok 6 deleted service\n       Finished verifying \u003cdefault-ubuntu-1004\u003e (1m18.10s).\n```\n\nTested system service provided by [Unix Mock Service Daemon](https://github.com/org-binbab/unix_service_mock_daemon)\n\n\n# Development and Maintenance\n\n* Found a bug?\n* Need some help?\n* Have a suggestion?\n* Want to contribute?\n\nPlease visit: [code.binbab.org](http://code.binbab.org)\n\n\n# Authors and License\n\n  * Author:: BinaryBabel OSS (\u003cprojects@binarybabel.org\u003e)\n  * Copyright:: 2013 `sha1(OWNER) = df334a7237f10846a0ca302bd323e35ee1463931`\n  * License:: Apache License, Version 2.0\n\n----\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrenatus%2Fcookbook-service_factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrenatus%2Fcookbook-service_factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrenatus%2Fcookbook-service_factory/lists"}