Removed the dirty sleep hack from the ejabberd service
svn path=/nixos/branches/upstart-0.6/; revision=18456
This commit is contained in:
parent
e171b6d86e
commit
a5cdfcbdb2
@ -57,6 +57,10 @@ in
|
|||||||
startOn = "started network-interface";
|
startOn = "started network-interface";
|
||||||
stopOn = "stopping network-interfaces";
|
stopOn = "stopping network-interfaces";
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
PATH = "$PATH:${pkgs.ejabberd}/sbin:${pkgs.ejabberd}/bin:${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.gnused}/bin";
|
||||||
|
};
|
||||||
|
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
# Initialise state data
|
# Initialise state data
|
||||||
@ -73,13 +77,13 @@ in
|
|||||||
cp ${pkgs.ejabberd}/etc/ejabberd/* ${cfg.confDir}
|
cp ${pkgs.ejabberd}/etc/ejabberd/* ${cfg.confDir}
|
||||||
sed -e 's|{hosts, \["localhost"\]}.|{hosts, \[${cfg.virtualHosts}\]}.|' ${pkgs.ejabberd}/etc/ejabberd/ejabberd.cfg > ${cfg.confDir}/ejabberd.cfg
|
sed -e 's|{hosts, \["localhost"\]}.|{hosts, \[${cfg.virtualHosts}\]}.|' ${pkgs.ejabberd}/etc/ejabberd/ejabberd.cfg > ${cfg.confDir}/ejabberd.cfg
|
||||||
fi
|
fi
|
||||||
'';
|
|
||||||
|
|
||||||
exec = "${pkgs.bash}/bin/sh -c 'export PATH=$PATH:${pkgs.ejabberd}/sbin:${pkgs.coreutils}/bin:${pkgs.bash}/bin; ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} start; sleep 1d'";
|
ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} start
|
||||||
|
'';
|
||||||
|
|
||||||
postStop =
|
postStop =
|
||||||
''
|
''
|
||||||
${pkgs.ejabberd}/sbin/ejabberdctl stop
|
ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} stop
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user