0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-12 05:16:25 +03:00

many daemons: depend on all-interfaces instead of gw6c

svn path=/nixos/trunk/; revision=32766
This commit is contained in:
Mathijs Kwik 2012-03-04 12:58:18 +00:00
parent ce83d3580e
commit 86bf5566fe
9 changed files with 13 additions and 34 deletions

View file

@ -4,8 +4,6 @@ with pkgs.lib;
let let
startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces";
cfg = config.services.dovecot; cfg = config.services.dovecot;
dovecotConf = dovecotConf =
@ -116,7 +114,7 @@ in
jobs.dovecot = jobs.dovecot =
{ description = "Dovecot IMAP/POP3 server"; { description = "Dovecot IMAP/POP3 server";
startOn = "started ${startingDependency}"; startOn = "started all-interfaces";
preStart = preStart =
'' ''

View file

@ -4,8 +4,6 @@ with pkgs.lib;
let let
startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces";
cfg = config.services.dovecot2; cfg = config.services.dovecot2;
dovecotConf = dovecotConf =
@ -125,7 +123,7 @@ in
jobs.dovecot2 = jobs.dovecot2 =
{ description = "Dovecot IMAP/POP3 server"; { description = "Dovecot IMAP/POP3 server";
startOn = "started ${startingDependency}"; startOn = "started all-interfaces";
preStart = preStart =
'' ''

View file

@ -4,8 +4,6 @@ with pkgs.lib;
let let
startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces";
cfg = config.services.postfix; cfg = config.services.postfix;
user = cfg.user; user = cfg.user;
group = cfg.group; group = cfg.group;
@ -21,9 +19,7 @@ let
default_privs = nobody default_privs = nobody
'' ''
+ optionalString (config.services.gw6c.enable || config.networking.enableIPv6) ('' + optionalString config.networking.enableIPv6 "inet_protocols = all"
inet_protocols = all
'')
+ (if cfg.networks != null then + (if cfg.networks != null then
'' ''
mynetworks = ${concatStringsSep ", " cfg.networks} mynetworks = ${concatStringsSep ", " cfg.networks}
@ -309,7 +305,7 @@ in
# accurate way is unlikely to be better. # accurate way is unlikely to be better.
{ description = "Postfix mail server"; { description = "Postfix mail server";
startOn = "started ${startingDependency}"; startOn = "started all-interfaces";
daemonType = "none"; daemonType = "none";

View file

@ -4,8 +4,6 @@ with pkgs.lib;
let let
startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces";
cfg = config.services.bind; cfg = config.services.bind;
confFile = pkgs.writeText "named.conf" confFile = pkgs.writeText "named.conf"

View file

@ -5,7 +5,7 @@ export PATH=@coreutils@/bin
if test "$1" = "start"; then if test "$1" = "start"; then
if ! @procps@/bin/pgrep ircd; then if ! @procps@/bin/pgrep ircd; then
if @gw6cEnabled@; then if @ipv6Enabled@; then
while ! @iproute@/sbin/ip addr | while ! @iproute@/sbin/ip addr |
@gnugrep@/bin/grep inet6 | @gnugrep@/bin/grep inet6 |
@gnugrep@/bin/grep global; do @gnugrep@/bin/grep global; do

View file

@ -12,7 +12,7 @@ let
substFiles = [ "=>/conf" ./ircd.conf ]; substFiles = [ "=>/conf" ./ircd.conf ];
inherit (pkgs) ircdHybrid coreutils su iproute gnugrep procps; inherit (pkgs) ircdHybrid coreutils su iproute gnugrep procps;
gw6cEnabled = if config.services.gw6c.enable && config.services.gw6c.autorun then "true" else "false"; ipv6Enabled = if config.networking.enableIPv6 then "true" else "false";
inherit (cfg) serverName sid description adminEmail inherit (cfg) serverName sid description adminEmail
extraPort; extraPort;
@ -26,8 +26,6 @@ let
builder = ./builder.sh; builder = ./builder.sh;
}; };
startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces";
in in
{ {
@ -127,8 +125,8 @@ in
description = "IRCD Hybrid server"; description = "IRCD Hybrid server";
startOn = "started ${startingDependency}"; startOn = "started all-interfaces";
stopOn = "stopping ${startingDependency}"; stopOn = "stopping all-interfaces";
exec = "${ircdService}/bin/control start"; exec = "${ircdService}/bin/control start";
}; };

View file

@ -6,10 +6,8 @@ let
inherit (pkgs) jre openfire coreutils which gnugrep gawk gnused; inherit (pkgs) jre openfire coreutils which gnugrep gawk gnused;
startDependency = extraStartDependency =
if config.services.openfire.usePostgreSQL then "postgresql" else if config.services.openfire.usePostgreSQL then "and started postgresql" else "";
if config.services.gw6c.enable then "gw6c" else
"network-interfaces";
in in
@ -50,7 +48,7 @@ in
jobs.openfire = jobs.openfire =
{ description = "OpenFire XMPP server"; { description = "OpenFire XMPP server";
startOn = "started ${startDependency}"; startOn = "started all-interfaces ${extraStartDependency}";
script = script =
'' ''

View file

@ -6,8 +6,6 @@ let
mainCfg = config.services.httpd; mainCfg = config.services.httpd;
startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces";
httpd = pkgs.apacheHttpd; httpd = pkgs.apacheHttpd;
getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80; getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80;
@ -555,7 +553,7 @@ in
description = "Apache HTTPD"; description = "Apache HTTPD";
startOn = "started ${startingDependency} and filesystem" startOn = "started all-interfaces and filesystem"
# Hacky. Some subservices depend on Postgres # Hacky. Some subservices depend on Postgres
# (e.g. Mediawiki), but they don't have a way to declare # (e.g. Mediawiki), but they don't have a way to declare
# that dependency. So just start httpd after postgresql if # that dependency. So just start httpd after postgresql if

View file

@ -6,11 +6,6 @@ let
configFile = ./xfs.conf; configFile = ./xfs.conf;
startingDependency =
if config.services.gw6c.enable && config.services.gw6c.autorun
then "gw6c"
else "network-interfaces";
in in
{ {
@ -41,7 +36,7 @@ in
jobs.xfs = jobs.xfs =
{ description = "X Font Server"; { description = "X Font Server";
startOn = "started ${startingDependency}"; startOn = "started all-interfaces";
exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}"; exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}";
}; };