{"id":15716582,"url":"https://github.com/gableroux/debian-service-generator","last_synced_at":"2026-04-30T01:38:51.826Z","repository":{"id":145782159,"uuid":"135493210","full_name":"GabLeRoux/debian-service-generator","owner":"GabLeRoux","description":"Generate debian services based on Sample /etc/init.d naholyr's gist","archived":false,"fork":false,"pushed_at":"2018-05-31T03:31:17.000Z","size":288,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T20:50:02.870Z","etag":null,"topics":["automation","debian","script","service","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/GabLeRoux.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-30T20:17:50.000Z","updated_at":"2018-05-31T02:59:43.000Z","dependencies_parsed_at":"2024-06-26T11:20:42.723Z","dependency_job_id":null,"html_url":"https://github.com/GabLeRoux/debian-service-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GabLeRoux/debian-service-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabLeRoux%2Fdebian-service-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabLeRoux%2Fdebian-service-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabLeRoux%2Fdebian-service-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabLeRoux%2Fdebian-service-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GabLeRoux","download_url":"https://codeload.github.com/GabLeRoux/debian-service-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabLeRoux%2Fdebian-service-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32451481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: 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":["automation","debian","script","service","shell"],"created_at":"2024-10-03T21:46:11.689Z","updated_at":"2026-04-30T01:38:51.793Z","avatar_url":"https://github.com/GabLeRoux.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample service script for debianoids\n\nGenerate debian services based on [Sample /etc/init.d naholyr's gist](https://gist.github.com/naholyr/4275302) and [wyhasany/sample-service-script repository](https://github.com/wyhasany/sample-service-script)\n\n## Resources\n\n* [LSB init scripts](http://wiki.debian.org/LSBInitScripts) for more information.\n* [MetaInit debian package](https://wiki.debian.org/MetaInit) to do something similar as this repository \n\n## Usage\n\nCopy to `/etc/init.d`:\n\n```sh\n# replace \"$YOUR_SERVICE_NAME\" with your service's name (whenever it's not enough obvious)\ncp \"service.sh\" \"/etc/init.d/$YOUR_SERVICE_NAME\"\nchmod +x /etc/init.d/$YOUR_SERVICE_NAME\n```\n\nEdit the script and replace following tokens:\n\n* `\u003cNAME\u003e` = `$YOUR_SERVICE_NAME`\n* `\u003cDESCRIPTION\u003e` = Describe your service here (be concise)\n* Feel free to modify the LSB header, I've made default choices you may not agree with\n* `\u003cCOMMAND\u003e` = Command to start your server (for example `/home/myuser/.dropbox-dist/dropboxd`)\n* `\u003cUSER\u003e` = Login of the system user the script should be run as (for example `myuser`)\n\nStart and test your service:\n\n```sh\nservice $YOUR_SERVICE_NAME start\nservice $YOUR_SERVICE_NAME stop\n```\n\nInstall service to be run at boot-time:\n\n```sh\nupdate-rc.d $YOUR_SERVICE_NAME defaults\n```\nFor rpm based distributions such as CentOS or Red Hat, you can use\n\n```sh\nchkconfig $YOUR_SERVICE_NAME --add\n```\nIf you want to see which runlevel your script will run in\n\n```sh\nchkconfig $YOUR_SERVICE_NAME --list\n```\n\nEnjoy\n\n## Uninstall\n\nThe service can uninstall itself with `service $NAME uninstall`. Yes, that's very easy, therefore a bit dangerous. But as it's an auto-generated script, you can bring it back very easily. I use it for tests and often install/uninstall, that's why I've put that here.\n\nDon't want it? Remove lines 56-58 of the service's script.\n\n## Logs?\n\nYour service will log its output to `/var/log/$NAME.log`. Don't forget to setup a *logrotate*.\n\n### logrotate example\n\nUsing heredocs to create `/etc/logrotate.d/$NAME.conf` :tada:\n\n```sh\ncat \u003c\u003c EOF \u003e /etc/logrotate.d/$NAME.conf\n/var/log/$NAME.log {\n  weekly\n  missingok\n  compress\n  delaycompress\n  notifempty\n  copytruncate\n}\nEOF\n```\n\n## Automated installation\n\n```sh\nwget 'https://raw.githubusercontent.com/GabLeRoux/debian-service-generator/master/new-service.sh' \u0026\u0026 bash new-service.sh\n```\n\nIn this script I will download `service.sh` into a `tempfile`, replace some tokens, and then show you commands you should run as superuser.\n\nIf you feel confident enough with my script, you can `sudo` the script directly:\n\n```sh\nwget 'https://raw.githubusercontent.com/GabLeRoux/debian-service-generator/master/new-service.sh' \u0026\u0026 sudo bash new-service.sh\n```\n\nThe script works offline so you can clone this repository and upload this script on your server and run it directly:\n\n```sh\nsudo bash new-service.sh\n```\n\nThe script also handle parameters as showed below:\n\n```sh\nsudo bash new-service.sh \"service_name\" \"description\" \"command to execute\" \"user which should run command\"\n```\n\n### Demo\n\nCreating the service:\n\n![service-create](screenshots/service-create.png)\n\nLooking at service files (logs, pid):\n\n![service-files](screenshots/service-files.png)\n\nUninstalling service:\n\n![service-uninstall](screenshots/service-uninstall.png)\n\n## LICENSE\n\n[MIT](LICENSE.md) © [Gabriel Le Breton](https://gableroux.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgableroux%2Fdebian-service-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgableroux%2Fdebian-service-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgableroux%2Fdebian-service-generator/lists"}