class backendHandler dir_root (frontend_lst: frontendHandler list) =
let mk_rel_path = delete_prefix dir_root in object(this)
- val file_regexp = ref (Str.regexp "[a-zA-Z][a-zA-Z0-9_'.']*")
+ val file_regexp = ref (Str.regexp "[a-zA-Z][a-zA-Z0-9_\.]*")
method new_dir fqp func =
let s = Unix.stat fqp in
method unlink rp =
match rp with Relpath(rel) ->
- let fqp = String.concat "/" [root_dir;rel] in
- Unix.unlink fqp
+ let fqp1 = String.concat "/" [root_dir;rel;".in"] in
+ let fqp2 = String.concat "/" [root_dir;rel;".out"] in
+ try
+ Unix.unlink fqp1;
+ Unix.unlink fqp2
+ with _ ->
+ printf "Hm. %s disappeared. Never mind\n" fqp1;flush Pervasives.stdout
method rmdir rp =
match rp with Relpath(rel) ->
let fqp = String.concat "/" [root_dir;rel] in
+ try
Unix.rmdir fqp
+ with _ ->
+ printf "Hm. %s disappeared. Never mind\n" fqp;flush Pervasives.stdout
end
echo -n "Starting vsys:"
if [ ! -d $backend ]; then mkdir $backend; fi
find /vservers -maxdepth 1 -type d | perl -e 'while (<>) {if (/(\/vservers\/(.*_.*))/) {$dir=$1;if (not (-d "$dir/vsys")) {mkdir "$dir/vsys";}}}'
- frontends=`find /vservers -maxdepth 1 -type d | perl -e 'while (<>) {if (/(\/vservers\/(.*_.*))/) {$dir=$1;$slice=$2;printf "-frontend $dir $slice "}}'`
+ frontends=`find /vservers -maxdepth 1 -type d | perl -e 'while (<>) {if (/(\/vservers\/(.*_.*))/) {$dir=$1;$slice=$2;printf "-frontend $dir/vsys $slice "}}'`
vsys_command="/usr/bin/vsys -backend $backend $frontends"
echo $vsys_command
$vsys_command