confz

git mirror of https://ccx.te2000.cz/bzr/confz
git clone https://ccx.te2000.cz/git/confz
Log | Files | Refs

commit 5f4c2ff0e325efcff90f8bb789216843ef64dd77
parent 6839beefd2ea5c6b2ca81aa585ce2ce459bdad27
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Tue, 21 Apr 2015 14:32:35 +0200

create directories in /var/run

Diffstat:
Mzsh-functions/confz_vserver_init | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/zsh-functions/confz_vserver_init b/zsh-functions/confz_vserver_init @@ -22,6 +22,19 @@ confz_deployed_system_check() { } +# create required directories +confz_vserver_run_dirs_check() { + local -a run_dirs + local d + run_dirs=( /var/run/{vservers,vservers.rev,vshelper} + do_command=( mkdir -p $run_dirs ) + + for d in $run_dirs; do + fail_reason="missing directory: ${(q)d}" + [[ -d $d ]] || return $? + done + return 0 +} # configure and deploy vserver confz_vserver_check() { @@ -74,6 +87,7 @@ confz_vserver_do() { confz_vserver_started_check() { checkvars name + require vserver_run_dirs do_command=( vserver -- $vars[name] start ) vserver --silent -- $vars[name] running || return $? local context_id