{"id":15891325,"url":"https://github.com/can-sahin/sample-service-script","last_synced_at":"2025-07-03T09:31:34.131Z","repository":{"id":144174166,"uuid":"117224858","full_name":"Can-Sahin/Sample-Service-Script","owner":"Can-Sahin","description":"Sample SystemV init script (service script) for rpm-based linux, that is compatible with Amazon Linux AMI","archived":false,"fork":false,"pushed_at":"2018-01-14T16:05:06.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-02T17:28:37.296Z","etag":null,"topics":["amazonlinux","initscript"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Can-Sahin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-01-12T09:58:52.000Z","updated_at":"2018-01-12T16:11:26.000Z","dependencies_parsed_at":"2023-08-12T00:50:49.909Z","dependency_job_id":null,"html_url":"https://github.com/Can-Sahin/Sample-Service-Script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Can-Sahin/Sample-Service-Script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Can-Sahin%2FSample-Service-Script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Can-Sahin%2FSample-Service-Script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Can-Sahin%2FSample-Service-Script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Can-Sahin%2FSample-Service-Script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Can-Sahin","download_url":"https://codeload.github.com/Can-Sahin/Sample-Service-Script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Can-Sahin%2FSample-Service-Script/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263300203,"owners_count":23445199,"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":["amazonlinux","initscript"],"created_at":"2024-10-06T07:21:36.689Z","updated_at":"2025-07-03T09:31:34.099Z","avatar_url":"https://github.com/Can-Sahin.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Sample Service Script for Amazon (RHEL-based) Linux AMI \nSample System V init script (service script) for startup services that is written for [Amazon Linux AMI] (and therefore for RHEL-based linux). Alternative to 'linux daemons' which AWS Linux AMI does not support.\n\nOriginal script is taken from [wyhasany's script]\n\nAnd:\n- Modified and improved for running on Amazon's RHEL-compatible Linux Image\n- Added Environment Variables configuration at startup to enable different configurations at the runtime (for stages like 'Dev', 'Prod'...)\n\nLook at [LSB init scripts] / System V init scripts for more information.\n\n## Usage\n\n\nDownload the script ExampleService.sh\n\nSome example values and implementation is provided in the script. For now, on run it writes Environment Values to the log file\n\n\nEdit the script by replacing the fields in between the `\u003cEdit Following Fields\u003e` tag with your own values:\n* Modify the LSB header. Change `ExampleService` with your name and change default configuration if you wish\n* `SERVICE_NAME` = Your service's name\n* `SCRIPT` = Your script to run on service start\n* `RUNAS` = User to run the `SCRIPT` as\n* `PidFileLocation` = Location of PIDFILE to store\n* `LogFileLocation` = Location of LOGFILE to store\n* Optionally customize Environment Values according to the Runtime as its explained in the script\n\nStart and test your service:\n\n**Install the service to `/etc/init.d` with install command**\n```sh\n# sh {YOUR_SCRIPT_NAME} install\nsh ExampleService.sh install\n```\nIt configures the service to `chkconfig`.  If you don't want to run at boot-time then delete it from `chkconfig`\n```sh\n# chkconfig --del {YOUR_SERVICE_NAME}\nchkconfig --del ExampleService\n```\n\n**Start the service**\n\n```sh\nservice ExampleService start\n```\n\n**Start the service with custom Environment Variables.**\n\nIf you define Environment Variables for ,say, 'Dev' in the script like;\n\n `EnvironmentVariables_Dev=( \"ConnString:DevString\" \"ASPNETCORE_ENVIRONMENT:Dev\" )\n`\n\nthen start the service with `--environment` option\n```sh\nservice ExampleService --environment Dev start\n```\n**Other commands**\n\n` start , stop , status , restart , install , uninstall`\n\nUsage: \n  `service ExampleService --environment Dev {optional} start | stop | status | restart | install | uninstall`\n\n[Amazon Linux AMI]: https://aws.amazon.com/amazon-linux-ami/\n[wyhasany's script]: https://github.com/wyhasany/sample-service-script\n[LSB init scripts]: https://wiki.debian.org/LSBInitScripts\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcan-sahin%2Fsample-service-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcan-sahin%2Fsample-service-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcan-sahin%2Fsample-service-script/lists"}