From 8d5884e01fb134dd1412dac77e8302d7a921d4b5 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Mon, 28 Jan 2008 15:16:14 +0000 Subject: [PATCH] Added JBoss service svn path=/nixos/trunk/; revision=10309 --- system/options.nix | 36 ++++++++++++++++++++++++++++++++++++ upstart-jobs/default.nix | 6 ++++++ upstart-jobs/jboss.nix | 21 +++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 upstart-jobs/jboss.nix diff --git a/system/options.nix b/system/options.nix index 332ae0217a1..02f03d8f4aa 100644 --- a/system/options.nix +++ b/system/options.nix @@ -985,6 +985,42 @@ }; + jboss = { + tempDir = mkOption { + default = "/tmp"; + description = "Location where JBoss stores its temp files"; + }; + + logDir = mkOption { + default = "/var/log/jboss"; + description = "Location of the logfile directory of JBoss"; + }; + + serverDir = mkOption { + description = "Location of the server instance files"; + default = "/var/jboss/server"; + }; + + deployDir = mkOption { + description = "Location of the deployment files"; + default = "/nix/var/nix/profiles/default/server/default/deploy/"; + }; + + libUrl = mkOption { + default = "file:///nix/var/nix/profiles/default/server/default/lib"; + description = "Location where the shared library JARs are stored"; + }; + + user = mkOption { + default = "nobody"; + description = "User account under which jboss runs."; + }; + + useJK = mkOption { + default = false; + description = "Whether to use to connector to the Apache HTTP server"; + }; + }; httpd = { diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index dc049f36812..5d5d24ec61f 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -182,6 +182,12 @@ let "gw6c" else "network-interfaces"; }) + # JBoss service + ++ optional config.services.jboss.enable + (import ../upstart-jobs/jboss.nix { + inherit config pkgs; + }) + # Samba service. ++ optional config.services.samba.enable (import ../upstart-jobs/samba.nix { diff --git a/upstart-jobs/jboss.nix b/upstart-jobs/jboss.nix new file mode 100644 index 00000000000..f3a4025a904 --- /dev/null +++ b/upstart-jobs/jboss.nix @@ -0,0 +1,21 @@ +args: with args; + +let + +cfg = config.services.jboss; +jbossService = import ../services/jboss { + inherit (pkgs) stdenv jboss su; + inherit (cfg) tempDir logDir libUrl deployDir serverDir user useJK; +}; + +in +{ + name = "jboss"; + job = " +description \"JBoss server\" + +stop on shutdown + +respawn ${jbossService}/bin/control start + "; +}