{"id":17996721,"url":"https://github.com/zk/leiningen-init-script","last_synced_at":"2025-12-12T01:11:47.022Z","repository":{"id":62433388,"uuid":"637540","full_name":"zk/leiningen-init-script","owner":"zk","description":"A leiningen plugin that generates *NIX daemon scripts.","archived":false,"fork":false,"pushed_at":"2010-06-27T22:35:21.000Z","size":103,"stargazers_count":24,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T22:04:22.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/zk.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}},"created_at":"2010-04-29T05:17:31.000Z","updated_at":"2025-03-30T00:39:48.000Z","dependencies_parsed_at":"2022-11-01T20:45:50.757Z","dependency_job_id":null,"html_url":"https://github.com/zk/leiningen-init-script","commit_stats":null,"previous_names":["zkim/leiningen-init-script"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zk/leiningen-init-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk%2Fleiningen-init-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk%2Fleiningen-init-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk%2Fleiningen-init-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk%2Fleiningen-init-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zk","download_url":"https://codeload.github.com/zk/leiningen-init-script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk%2Fleiningen-init-script/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265228987,"owners_count":23731092,"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":[],"created_at":"2024-10-29T21:15:40.386Z","updated_at":"2025-12-12T01:11:46.981Z","avatar_url":"https://github.com/zk.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# leiningen-init-script\n\nA leiningen plugin that generates *NIX init scripts.  Alpha quality, verified working on OSX 10.6 and FC12.\n\nIn a nutshell, LSI generates the following artifacts which can be found in your \u003cproject-root\u003e/init-script dir:\n\n* Project Uberjar\n\u003cbr /\u003e\n\n* \u003cyour-project-name\u003ed script\n\t\n\tPaired down from the Fedora Core init script template, injected with values from your lein project.clj.\n\u003cbr /\u003e\n\n* install-\u003cyour-project-name\u003e script\n\t\n\tCreates (but does not overwrite) the :pid-dir, :install-dir, and :init-script-dir directories.  To override the defaults see the Configuration section below.\n\u003cbr /\u003e\n\n* clean-\u003cyour-project-name\u003e script \n\n\tRemoves the init script, and uberjar from their respective install paths.  Does not remove any created directories.\n\u003cbr /\u003e\n\nIf you have an feature suggestions / bug reports, please open up an [issue](https://github.com/zkim/leiningen-init-script/issues)\n\n## Why?\n\nBecause it was too damn time-consuming to turn a java program into a *nix daemon service that can be started / stopped asyncronously, chkconfig'd, etc.\n\n## Lein\n\nAdd \u003ccode\u003e[leiningen-init-script \"1.2.0-SNAPSHOT\"]\u003c/code\u003e to the :dev-dependencies section in your project.clj.\n\n## Configuration\n\nleiningen-init-script takes several options in the form of:\n\n\t{:name \"override-project-name\"\n     :pid-dir \"/var/run\"\n     :install-dir \"/usr/local/my-project-name\"\n     :init-script-dir \"/etc/init.d\"\n\t :redirect-output-to \"/log/file or /dev/null\"\n\t :properties {:clj-config.env \"dev\"\n\t\t\t\t  :java.library.path \"/some/dir\"\n\t\t\t\t  :init.script.test.prop \"prop with spaces\"}\n\t :java-opts [\"-server\"\n\t\t\t\t \"-Xms256M\"\n\t\t\t\t \"-Xmx512M\"\n\t\t\t\t \"-XX:MaxPermSize=128M\"]}\n\nwhich are passed to the the init-script task by adding a :lis-opts entry to the project map. For example:\n\n\t(defproject init-script-test \"0.1.0\"\n\t  :description \"Test project for leiningen-init-script\"\n\t  :dependencies [[org.clojure/clojure \"1.1.0\"]\n\t                 [org.clojure/clojure-contrib \"1.1.0\"]]\n\t  :dev-dependencies [[leiningen-init-script \"1.2.0-SNAPSHOT\"]]\n\t  :lis-opts {:redirect-output-to \"/var/log/init-script-test.log\"\n\t             :properties {:clj-config.env \"dev\"\n\t\t\t\t  \t\t\t  :java.library.path \"/some/dir\"\n\t\t\t\t  \t\t\t  :init.script.test.prop \"prop with spaces\"}\n\t\t         :java-opts [\"-server\"\n\t\t\t\t\t\t\t \"-Xms256M\"\n\t\t\t\t \t\t\t \"-Xmx512M\"\n\t\t\t\t \t\t\t \"-XX:MaxPermSize=128M\"]}\n\t  :main main)\n\t\n\n\n## Usage\n\n### Short Version\nCreate a main class for your project, run \u003ccode\u003elein init-script\u003c/code\u003e, and check the ./init-script directory.\n\n\n### Long Version\n#### Taken from the [init-script-test](http://github.com/zkim/init-script-test) project.\n\nClone the init-script-test repo\n\n    git clone git://github.com/zkim/init-script-test.git\n\ncd into the cloned repo directory\n\n\tcd init-script-test\u003c/code\u003e\n\t\nDownload dependencies\n\t\n\tlein deps\n\t\nRun the init-script task\n\t\n\tlein init-script\n\t\n\tYour output should look something like:\n\t\n\tCreated /Users/zkim/tmp/init-script-test/init-script-test.jar\n\tIncluding init-script-test.jar\n\tIncluding clojure-1.1.0.jar\n\tIncluding clojure-contrib-1.1.0.jar\n\tIncluding leiningen-init-script-0.1.0.jar\n\t*** Done generating init scripts, see the /Users/zkim/tmp/init-script-test/init-script/ directory\n\tnapple:init-script-test zkim$\n\t\ncd into the init-script directory\n\tcd ./init-script\n\t\nMake install-init-script-test, clean-init-script-test runnable\n\tchmod u+x ./install-init-script-test\n\tchmod u+x ./clean-init-script-test\n\t\nInstall init script and jar\n\tsudo ./install-init-script-test\n\t\nleiningen-init-script installs the jar to /usr/local/\u003cproject-name\u003e and the init script to /etc/init.d. These defaults can be changed, see the Configuration section of the [leiningen-init-script](http://github.com/zkim/leiningen-init-script) README\n\n\nStart the daemon service\n\tsudo /etc/init.d/init-script-testd start\n\t\nVerify the jar is running\n\tps -e\n\t\n\tOutput:\n\t\n\t44678 ttys003    0:00.01 login -pf zkim\n\t44679 ttys003    0:00.11 -bash\n\t45216 ttys003    0:01.28 /usr/bin/java -jar /usr/local/init-script-test/init-script-test-standalone.jar\n\t45225 ttys003    0:00.00 ps -e\n\t\nStop the daemon service and verify the process has stopped\n\tsudo /etc/init.d/init-script-testd stop\n\t\n\tps -e\n\t\n\t44198 ttys002    0:00.09 -bash\n\t44678 ttys003    0:00.01 login -pf zkim\n\t44679 ttys003    0:00.11 -bash\n\t45248 ttys003    0:00.00 ps -e\n\n\n## Limitations\n\nNo Windows support at this time, if you'd like to see support for windows services, please open up an issue.\n\n## License\n\n[Eclipse Public License v1.0](http://www.eclipse.org/legal/epl-v10.html)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzk%2Fleiningen-init-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzk%2Fleiningen-init-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzk%2Fleiningen-init-script/lists"}