--- usr.bin/mkinittmpdir/Makefile
+++ usr.bin/mkinittmpdir/Makefile
@@ -0,0 +1,23 @@
+MAINTAINER= .@babolo.ru
+VERS	= \"1.03\"
+
+PROG  = mkinittmpdir
+CFLAGS += -Wall -DVERS=${VERS}
+
+.include <bsd.prog.mk>
+###########################################
+### While not in base system and developing
+#PREFIX?=/usr/contrib
+#DEBUG_FLAGS += -DDEBUG -g -Wall
+#CFLAGS += -DSYSRC=\"/usr/contrib/etc/tmpdirrc\" $(DEBUG_FLAGS)
+
+#############################
+### for another system prters
+
+#SRCS  = mkinittmpdir.c
+#MANS  = 
+
+#all: ${PROG} ${MANS}
+
+#clean:
+#	rm -f *.o *.core .depend *.bak ${PROG}
--- usr.bin/mkinittmpdir/mkinittmpdir.1
+++ usr.bin/mkinittmpdir/mkinittmpdir.1
@@ -0,0 +1,320 @@
+.\" Copyright (c)  @BABOLO V.M 1.03 ÏÔ 6 Jun 2000
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD:  $
+.\"
+.Dd 2000 April 28
+.Dt mkinittmpdir 1
+.Os
+.\"
+.Sh NAME
+.Nm mkinittmpdir
+.Nd create or choose
+.Va TMPDIR
+.\"
+.Sh SYNOPSIS
+.Nm
+.Op Fl suxhv
+.Op Fl f Ar Config
+.Op Fl d Ar TmpDir
+.Op Fl l Ar TmpDirLink
+.Op Fl t Ar TimeToLive
+.Op Fl n Ar Nice
+.\"
+.Sh DESCRIPTION
+The main goal of
+.Nm
+is temporary directory creation or choose it from possible directories.
+Usually it creates or choose temporary directory as
+.Pa TmpDir/${USER}
+or
+.Pa TmpDir/${USER}_XXXXXX Ns ,
+.Po
+as in
+.Xr mkdtemp 3
+.Pc
+where
+.Pa TmpDir
+is from
+.Fl d
+or
+.Va TMPDIR
+parameter in config files. After choosing or creation directory for
+temporary files symbolic link to this directory created
+.Pq "if configured so" Ns .
+After directory and link establishing
+.Nm
+execute all config files - system, user and forced
+.Pq "if configured so"
+with environment
+.Ev TMPDIR ,
+.Ev TMPDIRLINK
+and
+.Ev DELETED
+then launch
+.Xr deleted 1
+garbage collector daemon for chosen or created temporary directory.
+.Pp
+.Nm
+do not create any directory if possible and do not change
+.Va TMPDIRLINK
+if possible.
+.Pp
+Temporary directory can be chosen if it is writeable for user only.
+If several directories are possible then directory will be chosen
+in such a way that keep changes minimal.
+.Pp
+The following options are available:
+.Bl -tag -width Fl
+.It Fl s
+Do not use system wide config file.
+.It Fl u
+Do not use user config file.
+.It Fl x
+Do not execute any config file.
+.It Fl f Ar file
+Forced config file. Parameters in it overrides variables in user and system
+config files.
+.It Fl d Ar dir
+Forced temporary directory.
+.Va USER_SUBDIR
+forbidden when
+.Fl d
+is used.
+.It Fl l Ar link
+Link to
+.Va TMPDIR
+which can vary so
+.Va TMPDIRLINK
+may be used as stable
+path for
+.Va TMPDIR Ns .
+This link is one of sources config information.
+.It Fl t Ar TimeToLive
+.Va TimeToLive
+argument for
+.Xr deleted 1
+daemon.
+.It Fl n Ar Nice
+.Va Nice
+argument for
+.Xr deleted 1
+daemon.
+.It Fl h
+Short help.
+.It Fl v
+Increase verbosity.  More
+.Fl v Ns \&'s
+result in more information.
+.El
+Configuration file can be executed if has
+.Dl #!/bin/sh
+as first string begin and has appropriate x bit.
+.\"
+.Sh IMPLEMENTATION NOTES
+Configure information come from (listed high to low priority):
+.Bl -bullet -compact
+.It
+arguments list;
+.It
+.Fl f
+file;
+.It
+.Va TMPDIR
+environment variable;
+.It
+user config file;
+.It
+system wide config file;
+.It
+.Nm
+predefined
+.El
+.Pp
+Configuration files format is:
+.Bl -bullet -compact
+.It
+Possible string begins with
+.Dl #!/bin/sh
+.It
+Shell commands.
+.It
+.Va name=value
+pairs.
+.It
+Strings begins with # are comments.
+.El
+.Pp
+Parameter names used:
+.Bl -tag -width USER_SUBDIR -compact
+.It Va EXECUTE
+Permit or deny execution of config files in addition to
+use parameters from it.
+.It Va TMPDIR
+Overrides by
+.Fl d
+in command string.
+.Pa /tmp
+if not defined.
+.It Va USER_SUBDIR
+Allow or forbid use subdirectory in
+.Va TMPDIR Ns .
+Overrides by
+.Fl l
+in command string. Allow if not defined by another way.
+.It Va TMPDIRLINK
+Path to link to
+.Va TMPDIR Ns .
+Undefined by default.
+.It Va LINKED
+Allow or forbid use link to
+.Va TMPDIR
+.It Va DELETED
+Path to
+.Xr deleted 1
+daemon.
+.It Va DELETED_-t
+Time to live argument for
+.Xr deleted 1
+daemon.
+.It Va DELETED_-n
+Nice argument for
+.Xr deleted 1
+daemon.
+.El
+If creation or choose of
+.Va TMPDIR
+is not successful or script executed returns nonzero exit code than
+.Nm
+try this without user config file and then
+without both user and system config files.
+If some config files do not used then appropriate try is skipped.
+.\"
+.Sh RETURN VALUES
+.Nm
+always prints chosen or created temporary directory path to
+.Tn stdout
+without carriage return or line feed at end.
+If
+.Nm
+has no success in creation or choose temporary directory
+according to configuration, then
+.Pa /tmp
+is printed to
+.Tn stdout
+without any test of
+.Pa /tmp .
+.Nm
+substitutes
+.Dq Pa ~/
+and
+.Dq Pa ~user/
+for real absolute path.
+.\"
+.Sh ENVIRONMENT
+.Ev TMPDIR
+environment is used to configure
+.Nm
+besides other methods. If
+.Ev TMPDIR
+environment points to link, then
+.Dl TMPDIRLINK=<value of TMPDIR>
+.Dl LINKED=YES
+assumed. If
+.Ev TMPDIR
+do not points to link then path in
+.Ev TMPDIR
+or path pointed by link
+.Va TMPDIRLINK
+analised. If last component is
+.Pa ${USER}
+or
+.Pa ${USER}_XXXXXX
+then
+.Dl USER_SUBDIR=YES
+assumed and
+.Ev TMPDIR
+will be shortened one component.
+If path pointed by link or path from
+.Ev TMPDIR
+not pointing to link is another then
+.Dl USER_SUBDIR=NO
+and not changed
+.Ev TMPDIR 
+are assumed.
+.\"
+.Sh FILES
+.Bl -tag -width ~/.desk/tmpdirrc -compact
+.It Pa /etc/tmpdirrc
+system wide configuration file
+.It Pa ~/.desk/tmpdirrc
+user configuration file
+.El
+.Sh EXAMPLES
+.Nm
+intended for use in startup shell scripts:
+.Dl TMPDIR=`mkinittmpdir`
+in Bourne shells and
+.Dl setenv TMPDIR `mkinittmpdir`
+in C shells.
+.\"
+.Sh DIAGNOSTICS
+.Nm
+works silently and 0 is the only exit code.
+.Fl v
+can be used for debug print to
+.Tn stderr .
+.\"
+.Sh COMPATIBILITY
+The main reason for use
+.Nm
+is
+.Va TMPDIR
+setting. But it is a big work to do all applications
+.Va TMPDIR
+aware.
+.\"
+.Sh SEE ALSO
+.Xr mkdtemp 3 Ns ,
+.Xr deleted 1
+.\"
+.Sh HISTORY
+The
+.Nm
+command appeared in
+.Fx 4.1
+.\"
+.Sh AUTHORS
+.An Aleksandr A. Babaylov
+.Pq "aka @BABOLO"
+.Ad .@babolo.ru
+.Tn http://www.links.ru/~babolo/
+.\"
+.Sh BUGS
+Man
+.Pq text
+originally written by man
+.Pq human
+with no active English.
+Do the better if can.
--- usr.bin/mkinittmpdir/mkinittmpdir.c
+++ usr.bin/mkinittmpdir/mkinittmpdir.c
@@ -0,0 +1,882 @@
+/*-
+ * Copyright (c)  @BABOLO V.M 1.03 ÏÔ 26 May 2000
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $FreeBSD:  $ 
+ */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <sysexits.h>
+#include <limits.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <regex.h>
+#include <stdio.h>
+#include <err.h>
+#include <pwd.h>
+
+#ifndef  PREFIX
+# define PREFIX ""
+#endif/* PREFIX */
+
+#ifndef  USERRC
+# define USERRC "~/.desk/tmpdirrc"
+#endif/* USERRC */
+
+#ifndef  USERRB
+# define USERRB "~/.tmpdirrc"
+#endif/* USERRB */
+
+#ifndef  SYSRC
+# define SYSRC PREFIX"/etc/tmpdirrc"
+#endif/* SYSRC */
+
+#ifndef  SHELLTEST
+# define SHELLTEST "#!/bin/sh"
+#endif/* SHELLTEST */
+
+#ifndef  RERR_MAX
+# define RERR_MAX 80
+#endif/* RERR_MAX */
+
+#define WARN(A,B) {if(A) {B;}}
+#define CONT(A) {which_error = (A); continue;}
+enum bool {undef=-1, false=0, true=1};
+enum rcnames {argrc, forcerc, envrc, userrc, sysrc, defrc, sumrc};
+char rcnames[][8] = {"arg", "force", "env", "user", "sys", "def", "sum"};
+
+struct deleted_arg
+{   char *name;
+    char *arg;
+    struct deleted_arg *next;
+    struct deleted_arg *active;
+};
+
+struct cnf
+{   enum bool actual;                     /* Take in account?                               */
+    char *tmpdir;                         /* TMPDIR candidate                               */
+    enum bool user_subdir;                /* Does user name used as subdir?                 */
+    char *tmpdirlink;                     /* link path for TMPDIR                           */
+    enum bool tmpdir_linked;              /* Does TMPDIR exported is link to actual tmpdir? */
+    enum bool script;                     /* Does conf file is script too?                  */
+    char *deleted;                        /* deleted daemon path                            */
+    struct deleted_arg *deleted_args;     /* args for deleted                               */
+    char *fn;                             /* file name this conf came from                  */
+    enum bool exec;                       /* Permit/deny to execute rc files by /bin/sh     */
+};
+char *myname;
+struct passwd *pw;
+short flag_v;
+
+/*********************************
+ * input boolean paremeter       *
+ *********************************/
+enum bool inbool(enum bool def, char *in)
+{   struct ansvers
+    {   char word[8];
+        enum bool fullcompare;
+        enum bool mean;
+    } ansvers[] =
+        /* I have no right reason to do it as you see. Correct me please */
+        {   {"yes"    , true , true }    ,   {"no"     , true , false}
+        ,   {"ÄÁ"     , true , true }    ,   {"ÎÅÔ"    , true , false}
+        ,   {"tak"    , true , true }    ,   {"nie"    , true , false}
+        ,   {"ÔÁË"    , true , true }    ,   {"Îi"     , true , false}
+        ,   {"jawohl" , true , true }    ,   {"nicht"  , true , false}
+        ,   {"ja"     , true , true }    ,   {"nein"   , true , false}
+        ,   {"si"     , true , true }
+        ,   {"1"      , true , true }    ,   {"0"      , true , false}
+        ,   {"true"   , false, true }    ,   {"false"  , false, false}
+        ,   {"yes"    , false, true }    ,   {"no"     , false, false}
+        ,   {"up"     , false, true }    ,   {"down"   , false, false}
+        ,   {"+"      , false, true }    ,   {"-"      , false, false}
+        ,   {"y"      , false, true }    ,   {"n"      , false, false}
+        ,   {"allow"  , false, true }    ,   {"forbid" , false, false}
+        ,   {""       , undef, undef}
+        };
+    int i;
+    for (i = 0; ansvers[i].fullcompare != undef; i++)
+    {   if  (ansvers[i].fullcompare) {if (!strcasecmp(in, ansvers[i].word)) return(ansvers[i].mean);}
+        else if (!strncasecmp(in, ansvers[i].word, strlen(ansvers[i].word))) return(ansvers[i].mean);
+    }
+    return(def);
+}
+
+void ses(const char *name, const char *value)
+{   char *p;
+
+    if  (name && value)
+    {   p = getenv(name);
+        if  (value)
+        {   if  (!p || strcmp(p, value)) setenv(name, value, 1);
+        }else
+        {   if  (p) unsetenv(name);
+}   }   }
+
+void set_env(struct cnf *cnfsum)
+{   /* Try to optimise memory leaks due to setenv */
+    ses("TMPDIR"     , cnfsum->tmpdir);
+    ses("TMPDIRLINK" , cnfsum->tmpdir_linked ? cnfsum->tmpdirlink : NULL);
+    ses("DELETED"    , cnfsum->deleted);
+}
+
+int exr(regex_t *preg, char *pattern, int cflags)
+{   int errr = 0;
+    char abouterr[RERR_MAX + 1];
+
+    if  ((errr = regcomp(preg, pattern, cflags)) != 0)
+    {   (void)regerror(errr, preg, abouterr, RERR_MAX);
+        fprintf(stderr, "%s: ###2.2 %s:%s\n", myname, pattern, abouterr);
+    }
+    return(errr);
+}
+
+char *results[3];
+/*********************************
+ * find parameter in rc file     *
+ *********************************/
+char **gexr(char *config, off_t cfilen, const char *word)
+{   int errr;
+    size_t sz;
+    regex_t preg;
+    char *pattern, *p;
+    char pat1[] = "(^|";
+    char pat2[] = ")[ \t]*";
+    char pat3[] = "[ \t]*=[ \t]*([^ \t]|[^ \t].*[^ \t])[ \t\r\n]*(";
+    char pat4[] = "|$)";
+/*  (^|\0)[ \t]*WORD[ \t]*=[ \t]*([^ \t]|[^ \t].*[^ \t])[ \t\r\n]*(\0|$) */
+    regmatch_t pmatch[4];
+
+    if  (!config) return(NULL);
+    sz = strlen(word) + strlen(pat1) + strlen(pat2) + strlen(pat3) + strlen(pat4) + 3;
+    if  ((pattern = (char*)malloc(sz)) == NULL)
+    {   warn("Can't malloc pattern ###2.1");                                              return(NULL);
+    }
+    strcpy(pattern, pat1); p = index(pattern, '\0');
+    strcpy(++p,     pat2); p = index(p, '\0');
+    strcpy(  p,     word); p = index(p, '\0');
+    strcpy(  p,     pat3); p = index(p, '\0');
+    strcpy(++p,     pat4); p = index(p, '\0');
+    preg.re_endp = p;
+    errr = exr(&preg, pattern, REG_EXTENDED | REG_ICASE | REG_NEWLINE | REG_PEND);
+    free(pattern);
+    pattern = NULL;
+    if  (errr)                                                                            return(NULL);
+    results[0] = NULL;
+    results[1] = NULL;
+    results[2] = NULL;
+    pmatch[0].rm_so = 0;
+    pmatch[0].rm_eo = cfilen;
+    if  ((errr = regexec(&preg, config, (size_t)4, pmatch, REG_STARTEND)) == 0)
+    {   if  (pmatch[2].rm_eo > 0)
+        {   config[pmatch[2].rm_eo] = '\0';
+            results[0] = &config[pmatch[2].rm_so];
+        }
+        if  (pmatch[3].rm_eo > 0)
+        {   config[pmatch[3].rm_eo] = '\0';
+            results[1] = &config[pmatch[3].rm_so];
+    }   }
+    regfree(&preg);
+    return(results);
+}
+
+/************************
+ * DELETED args collect *
+ ************************/
+void darg(struct cnf *cnf, char *flag, char *arg)
+{   struct deleted_arg *d = (struct deleted_arg *)malloc(sizeof(struct deleted_arg));
+
+    if  (d)
+    {   d->active = NULL;
+        d->name = flag;
+        if  ((d->arg = strdup(arg)) != NULL)
+        {   d->next = cnf->deleted_args;
+            cnf->deleted_args = d;
+        }else warn("No memory, %s purged, ###3.1", flag);
+    }else warn("No memory, %s purged, ###3.2", flag);
+}
+
+/*********************************
+ * mkdir -p                      *
+ *********************************/
+int mk_dir(const char *path)
+{   char *p, *s, *tmp;
+    struct stat sb;
+
+    if  (!path || !*path) {fprintf(stderr, "%s: No path for mk_dir", myname);               return(1);}
+    if  ((tmp = strdup(path)) == NULL) {warn("No memory");                                  return(2);}
+    for (p = tmp; ; p = s, p++)
+    {   s = index(p, '/');
+        if (s) *s = '\0';
+        if (flag_v > 3) fprintf(stderr, "test/create=%s~\n", tmp);
+        if (*p && stat(tmp, &sb) && mkdir(tmp, 0700)) {warn("Can't create dir %s", path);   return(3);}
+        if (s) *s = '/'; else break;
+    }
+    free(tmp);
+    return(0);
+}
+
+/*********************************
+ * substitute ~ at path begin    *
+ *********************************/
+char *canonify(char *tc)
+{   char *p, *s;
+    struct passwd *pwu;
+    char path[PATH_MAX + 2];
+    int i;
+
+    p = NULL;
+    i = 0;
+    if  (strncmp(tc, "~/", 2) == 0) i = 2;
+    else if (strcmp(tc, "~") == 0) i = 1;
+    if  (i)
+    {   if (pw)
+        {   strncpy(path, pw->pw_dir, PATH_MAX + 1);
+            p = tc + i;
+        }
+    }else if  (strncmp(tc, "~", 1) == 0)                                      /* another user's home */
+    {   p = tc + 1;
+        s = path;
+        while (*p && *p != '/') *s++ = *p++;
+        if (*p && *p == '/') p++;
+        *s++ = '\0';
+        if  ((pwu = getpwnam(path)) == NULL)
+        {   p = NULL;                        fprintf(stderr, "%s: which is %s ###1.3\n", myname, path);
+        }else
+        {   strncpy(path, pwu->pw_dir, PATH_MAX + 1);
+        }
+    }else if (*tc == '/')
+    {   *path = '\0';
+        p = tc;
+    }else
+    {   if  (getcwd(path, PATH_MAX + 1) == NULL)                             warn("where am i ###1.4");
+        else p = tc;
+    }
+    if (!p) return(p);
+    /* copy rest of tc and delete // */
+    i = 0;
+    path[PATH_MAX + 1] = '\0';
+    s = index(path, '\0');
+    while (*p)
+    {   switch (i)
+        {case 0:
+            if  (*p == '/') p++;
+            else
+            {   *s++ = '/';
+                *s++ = *p++;
+                WARN(((s - path) > PATH_MAX)
+                    ,{   fprintf(stderr, "%s: ###1.5 Very long path %s\n", myname, tc);
+                         return(NULL);
+                     }
+                    );
+                i = 1;
+            };  break;
+         case 1:
+            if  (*p == '/')
+            {   p++;
+                i = 0;
+            }else
+            {   *s++ = *p++;
+                WARN(((s - path) > PATH_MAX)
+                    ,{   fprintf(stderr, "%s: ###1.6 Very long path %s\n", myname, tc);
+                         return(NULL);
+                     }
+                    );
+            };  break;
+    }   }
+    *s++ = '\0';
+    WARN(((p = strdup(path)) == NULL),               fprintf(stderr, "%s: no memory ###1.7\n", myname))
+    return(p);
+}
+
+/****************************************************************/
+void debug_print(struct cnf cnf[], short flag_s, short flag_u) /*
+ ****************************************************************/
+{   enum rcnames rc;
+    struct deleted_arg *darg;
+
+    fprintf(stderr, " myname=%s~   v=%d   s=%d   u=%d\n", myname, flag_v, flag_s, flag_u);
+    for (rc = argrc; rc <= sumrc ; rc++)
+    {   if  (!cnf[rc].actual) continue;
+        switch (rc)
+        {case argrc:   fprintf(stderr, "args:\n");                break;
+         case envrc:   fprintf(stderr, "env:\n");                 break;
+         case userrc:
+         case sysrc:
+         case forcerc: fprintf(stderr, "file %s:\n", cnf[rc].fn); break;
+         case defrc:   fprintf(stderr, "defaults:\n");            break;
+         case sumrc:   fprintf(stderr, "SUM:\n");                 break;
+        }
+        if  (cnf[rc].deleted) fprintf( stderr, "  deleted=%s~\n", cnf[rc].deleted);
+        darg = cnf[rc].deleted_args;
+        while (darg)
+        {   fprintf(stderr, "  + name=%s~   arg=%s~\n", darg->name, darg->arg);
+            if (rc == sumrc) darg = darg->active;
+            else darg = darg->next;
+        }
+        if  (cnf[rc].script != undef)
+            fprintf(stderr, "  script=%s", cnf[rc].script ? "TRUE" : "FALSE");
+        if  (cnf[rc].user_subdir != undef)
+            fprintf(stderr, " user_subdir=%s", cnf[rc].user_subdir ? "TRUE" : "FALSE");
+        if  (cnf[rc].tmpdir_linked != undef)
+            fprintf(stderr, " tmpdir_linked=%s", cnf[rc].tmpdir_linked ? "TRUE" : "FALSE");
+        if  (cnf[rc].exec != undef)
+            fprintf(stderr, " execute=%s", cnf[rc].exec ? "TRUE" : "FALSE");
+        fprintf(stderr, "\n");
+        if  (cnf[rc].tmpdirlink) fprintf( stderr, "  tmpdirlink=%s~\n", cnf[rc].tmpdirlink);
+        if  (cnf[rc].tmpdir) fprintf( stderr, "  tmpdir=%s~\n", cnf[rc].tmpdir);
+}   }
+
+/*********************************/
+void usage()                    /*
+ *********************************/
+{   fprintf( stderr
+           , "mkinittmpdir @BABOLO V.M "VERS" ÏÔ 15 Apr 2000\n"
+             "Usage:\n"
+             "    %s [-sux] [-f ConfigFile] [-d TmpDir] [-l TmpDirLink] [-t TimeToLive] [-n Nice]\n"
+             "    -x   do not execute config files\n"
+             "default config files:\n"
+             "    "USERRC" (if no -u)\n"
+             "    "SYSRC" (if no -s)\n"
+           , myname
+           );
+}
+
+/*****************************************************************************************************/
+int main(int argc, char **argv) /*********************************************************************
+ *****************************************************************************************************/
+{   char *p;
+    short flag_u = 0, flag_s = 0;
+    int c, i, try;
+    struct cnf cnf[sumrc + 1] =
+        /*actual tmpdir u_sub  link  linked script deld  d_arg fn    exec              */
+        {{false, NULL , undef, NULL, undef, false, NULL, NULL, NULL, undef} /* argrc   */
+        ,{false, NULL , undef, NULL, undef, false, NULL, NULL, NULL, undef} /* forcerc */
+        ,{false, NULL , undef, NULL, undef, false, NULL, NULL, NULL, undef} /* envrc   */
+        ,{false, NULL , undef, NULL, undef, false, NULL, NULL, NULL, undef} /* userrc  */
+        ,{false, NULL , undef, NULL, undef, false, NULL, NULL, NULL, undef} /* sysrc   */
+        ,{true, "/tmp", true,  NULL, false, false, NULL, NULL, NULL, undef} /* defrc   */
+        ,{false, NULL , undef, NULL, undef, false, NULL, NULL, NULL, undef} /* sumrc   */
+        };
+    struct cnf *cnfsum = &cnf[sumrc];
+    struct stat sb;
+    enum bool link_ok;
+                                                                                 /********************/
+                                                                                 /* BEGIN Parse args */
+    while ((p = rindex(*argv, '/')) != NULL)                                     /********************/
+    {   *p++ = '\0';
+        if  (*p)
+        {    *argv = p;
+             break;
+    }   }
+    myname = *argv;
+    if ((pw = getpwuid(getuid())) == NULL)                                  warn("which am i ###002");
+    flag_v = 0;
+    cnf[forcerc].fn = NULL;
+    while ((c = getopt(argc, argv, "vsuxn:t:l:d:f:h?")) > 0)
+    {   switch (c)
+        {case 'v': flag_v++;                                 break;
+         case 's': flag_s++;                                 break;
+         case 'u': flag_u++;                                 break;
+         case 'x': cnf[argrc].exec = false;                  break;
+         case 'n': darg(&cnf[argrc], "-n", optarg);          break;
+         case 't': darg(&cnf[argrc], "-t", optarg);          break;
+         case 'l': cnf[argrc].tmpdirlink = canonify(optarg); break;
+         case 'd': cnf[argrc].tmpdir = canonify(optarg);     break;
+         case 'f': cnf[forcerc].fn = canonify(optarg);       break;
+         case 'h':
+         case '?':
+         default: usage(); exit(EX_OK);
+    }   }
+    argc -= optind;
+    argv += optind;
+    if (cnf[argrc].tmpdir) cnf[argrc].user_subdir = false;
+    if (cnf[argrc].tmpdirlink) cnf[argrc].tmpdir_linked = true;
+    cnf[argrc].actual = true;                                                      /* END Parse args */
+
+                                                                         /****************************/
+                                                                         /* BEGIN Parse config files */
+    cnf[sysrc].fn = SYSRC;                                               /****************************/
+    cnf[userrc].fn = canonify(USERRC);
+    if  (stat(cnf[userrc].fn, &sb)) cnf[userrc].fn = canonify(USERRB);
+    for (i = 0; i < 3; i++)
+    {   enum rcnames rc;
+        char *config, *c;
+        int fd;
+        struct stat sb;
+        off_t cfilen, l;
+        int k;
+
+    ;   switch (i)
+        {default: rc = sysrc;   break;
+    ;    case 1:  rc = userrc;  break;
+    ;    case 0:  rc = forcerc; break;
+    ;   }
+    ;   if  (!cnf[rc].fn) continue;
+    ;   if  ((fd = open(cnf[rc].fn, O_RDONLY)) < 0)
+        {   WARN((rc == forcerc),                                       warn("###011 %s", cnf[rc].fn));
+    ;       continue;
+    ;   }
+    ;   if  (fstat(fd, &sb))
+        {   WARN((rc == forcerc),                                       warn("###012 %s", cnf[rc].fn));
+    ;       continue;
+    ;   }
+    ;   cfilen = sb.st_size;
+    ;   config = (char*)mmap(NULL, cfilen, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, (off_t)0);
+    ;   if  (config == NULL)
+        {   WARN((rc == forcerc),                                       warn("###013 %s", cnf[rc].fn));
+    ;       continue;
+    ;   }
+    ;   if (flag_v > 4) fprintf(stderr, "Parse %src: %s~\n", rcnames[rc], cnf[rc].fn);
+
+#define CNFS(A,B) \
+        {   if  ((A) == NULL)\
+            {   char *LOCAL_ONLY = *gexr(config, cfilen, B);\
+                if (LOCAL_ONLY) (A) = canonify(LOCAL_ONLY);\
+        }   }
+#define CNFB(A,B) \
+        {   if  ((A) == undef)\
+            {   char *LOCAL_ONLY = *gexr(config, cfilen, B);\
+                if (LOCAL_ONLY) (A) = inbool(undef, LOCAL_ONLY);\
+        }   }
+    ;   CNFS(cnf[rc].tmpdir       , "TMPDIR");
+    ;   CNFB(cnf[rc].user_subdir  , "USER_SUBDIR");
+    ;   CNFS(cnf[rc].tmpdirlink   , "TMPDIRLINK");
+    ;   CNFB(cnf[rc].tmpdir_linked, "LINKED");
+    ;   CNFB(cnf[rc].exec         , "EXECUTE");
+    ;   if  (!(cnf[rc].deleted))
+        {   char *LOCAL_ONLY = *gexr(config, cfilen, "DELETED");
+    ;       if (LOCAL_ONLY) cnf[rc].deleted = strdup(LOCAL_ONLY);
+    ;   }
+#undef CNFB
+#undef CNFS
+
+    ;   cnf[rc].actual = true;
+    ;   cnf[rc].script = false;
+    ;   k = strlen(SHELLTEST);
+    ;   if  (   cfilen > k
+            &&  !strncmp(config, SHELLTEST, k)
+            &&  (   config[k] == ' '
+                ||  config[k] == '\t'
+                ||  config[k] == '\0'
+                ||  config[k] == '\n'
+            )   )
+        {   if      (pw->pw_uid == sb.st_uid) cnf[rc].script = !(!(sb.st_mode & S_IXUSR));
+            else if (pw->pw_gid == sb.st_gid) cnf[rc].script = !(!(sb.st_mode & S_IXGRP));
+            else                              cnf[rc].script = !(!(sb.st_mode & S_IXOTH));
+    ;   }
+    ;   c = config; l = cfilen;
+    ;   for (;;)
+        {   char **s = gexr(c, l, "DELETED_([-0-9_A-Z]+)");
+    ;       if (!*s) break;
+    ;       darg(&cnf[rc], strdup(s[0]), s[1]);
+    ;   }
+    ;   WARN((munmap(config, cfilen)),                                  warn("###015 %s", cnf[rc].fn));
+    }                                                                      /* END Parse config files */
+
+                                                                           /**************************/
+                                                                           /* BEGIN Parse TMPDIR env */
+    if  ((p = getenv("TMPDIR")) != NULL && *p)                             /**************************/
+    {   char *tmplink = canonify(p);
+        struct stat sb;
+
+    ;   cnf[envrc].actual = true;
+    ;   if  (tmplink == NULL) cnf[envrc].actual = false;
+        else if (lstat(tmplink, &sb))
+        {   cnf[envrc].tmpdir_linked = true;
+    ;       cnf[envrc].user_subdir   = true;
+    ;       cnf[envrc].tmpdirlink = tmplink;
+    ;   }else if (S_ISLNK(sb.st_mode))
+        {   int i, j;
+            char *s = NULL;
+            char *p = (char*)malloc(PATH_MAX + 1);
+
+    ;       for (i = 0;;i++)
+            {   if  ((j =readlink(i ? s : tmplink, p, PATH_MAX)) < 0)
+                {   free(p);
+    ;               if (i) free(s);
+    ;               p = NULL;
+    ;               s = NULL;
+    ;               warn("###021 %s", (i ? s : tmplink));
+    ;               break;
+    ;           }
+    ;           p[j] = '\0';
+    ;           s = canonify(p);
+
+    ;           if  (i > 32)
+                {   fprintf(stderr, "%s: ###022 Loop symlink %s detected\n", myname, tmplink);
+    ;               free(p);
+    ;               free(s);
+    ;               p = NULL;
+    ;               s = NULL;
+    ;               break;
+    ;           }
+    ;           if  (lstat(s, &sb))
+                {   fprintf(stderr, "%s: ###023 Symlink %s points to nothing\n", myname, tmplink);
+    ;               free(p);
+    ;               free(s);
+    ;               p = NULL;
+    ;               s = NULL;
+    ;               break;
+    ;           }else if (S_ISLNK(sb.st_mode)) continue;
+                else if (S_ISDIR(sb.st_mode))
+                {   char *pattern;
+                    regex_t preg;
+                    regmatch_t pmatch[2];
+
+    ;               if  (asprintf( &pattern, ".*(/%s|/%s_[0-9a-zA-Z]{6})$"
+                                 , pw->pw_name, pw->pw_name
+                                 ) < 0
+                        )
+                    {   warn("###024 Can't asprintf pattern");
+                    }else if (   !exr(&preg, pattern, REG_EXTENDED)
+                             &&  !regexec(&preg, s, (size_t)2, pmatch, 0)
+                             )
+                    {   s[pmatch[1].rm_so] = '\0';
+    ;                   cnf[envrc].user_subdir = true;
+    ;               }
+    ;               cnf[envrc].tmpdir = s;
+    ;               free(pattern);
+    ;               free(p);
+    ;               break;
+    ;           }else fprintf(stderr, "%s: ###025 TMPDIR=%s points to not directory\n", myname, p);
+    ;       }
+    ;       if (cnf[envrc].user_subdir == undef) cnf[envrc].user_subdir = false;
+    ;       cnf[envrc].tmpdir_linked = true;
+    ;       cnf[envrc].tmpdirlink = tmplink;
+    ;   }else if (S_ISDIR(sb.st_mode))
+        {   cnf[envrc].tmpdir_linked = false;
+    ;       cnf[envrc].user_subdir   = false;
+    ;       cnf[envrc].tmpdir = tmplink;
+    ;   }else
+        {   fprintf(stderr, "%s: ###026 TMPDIR=%s is not link nor directory\n", myname, p);
+    ;       cnf[envrc].actual = false;
+    }   }                                                                    /* END Parse TMPDIR env */
+
+    if (flag_u) cnf[userrc].actual = false;
+    if (flag_s) cnf[sysrc].actual = false;
+
+                                                                                        /*************/
+                                                                                        /* BEGIN Try */
+    for (try = 0;; try++)                                                               /*************/
+    {   int which_error = 0;
+        enum rcnames rc;
+        struct deleted_arg *darg, *larg;
+        struct {dev_t d; ino_t i;} tmpdir_inod;
+        int st;
+
+        if  (try && flag_v > 2) fprintf(stderr, "***** ###030 Error %d\n", which_error);
+        if  (flag_v > 3) fprintf(stderr, "***** ###031 Try %d\n", try);
+        switch (try)
+        {case 1:
+            if  (cnf[envrc].actual)
+            {   cnf[envrc].actual = false;
+                break;
+            }
+            try++;
+            if (flag_v > 3) fprintf(stderr, "***** ###032 Try raise %d\n", try);
+         case 2:
+            if  (cnf[userrc].actual)
+            {   cnf[userrc].actual = false;
+                break;
+            }
+            try++;
+            if (flag_v > 3) fprintf(stderr, "***** ###032 Try raise %d\n", try);
+         case 3:
+            if (cnf[sysrc].actual)
+            {   cnf[sysrc].actual = false;
+                break;
+            }
+            try++;
+            if (flag_v > 3) fprintf(stderr, "***** ###033 Try raise %d\n", try);
+         case 4:
+            if ((flag_v > 2)) fprintf(stderr, "***** ###034 Fault\n");
+            printf("%s", cnf[defrc].tmpdir);
+            exit(EX_OK);
+        }
+        which_error = 0;
+                                                                 /************************************/
+                                                                 /* BEGIN make summary configuration */
+        larg = NULL;                                             /************************************/
+        cnfsum->actual        = false;
+        cnfsum->tmpdir        = NULL;
+        cnfsum->user_subdir   = undef;
+        cnfsum->tmpdirlink    = NULL;
+        cnfsum->tmpdir_linked = undef;
+        cnfsum->script        = false;
+        cnfsum->deleted       = NULL;
+        cnfsum->deleted_args  = NULL;
+        cnfsum->fn            = NULL;
+        cnfsum->exec          = undef;
+        for (rc = argrc; rc < sumrc; rc++)
+        {   if  (cnf[rc].actual)
+            {   if  (!cnfsum->tmpdir)                cnfsum->tmpdir        = cnf[rc].tmpdir;
+        ;       if  (!cnfsum->tmpdirlink)            cnfsum->tmpdirlink    = cnf[rc].tmpdirlink;
+        ;       if  (!cnfsum->deleted)               cnfsum->deleted       = cnf[rc].deleted;
+        ;       if  (cnfsum->user_subdir   == undef) cnfsum->user_subdir   = cnf[rc].user_subdir;
+        ;       if  (cnfsum->tmpdir_linked == undef) cnfsum->tmpdir_linked = cnf[rc].tmpdir_linked;
+        ;       if  (cnfsum->exec          == undef) cnfsum->exec          = cnf[rc].exec;
+        ;       for (darg = cnf[rc].deleted_args; darg; darg = darg->next)
+                {   if  (!cnfsum->deleted_args) cnfsum->deleted_args = darg;
+        ;           if  (larg)
+                    {   larg->active = darg;
+        ;               larg = NULL;
+        ;           }
+        ;           if ((darg->active = darg->next) == NULL) larg = darg;
+        }   }   }
+        for (darg = cnfsum->deleted_args; darg; darg = darg->active)
+        {   for (larg = darg; larg;)
+            {   if  (larg->active && !strcmp(larg->active->name, darg->name))
+                    larg->active = larg->active->active;
+                else larg = larg->active;
+        }   }
+        if  (cnfsum->user_subdir == undef) cnfsum->user_subdir = false;
+        if  (cnfsum->tmpdir_linked == undef) cnfsum->tmpdir_linked = false;
+        if  (mk_dir(cnfsum->tmpdir))                                                         CONT(041)
+        cnfsum->actual = true;                                     /* END make summary configuration */
+
+
+        if  (flag_v > 2) debug_print(cnf, flag_s, flag_u);
+
+                                                                                /*********************/
+                                                                                /* BEGIN make TMPDIR */
+        link_ok = false;                                                        /*********************/
+        if  (cnfsum->user_subdir)
+        {  /**************************************************
+            * Try to reuse some directory with unknown name. *
+            * Search in possible TMPDIRs for that            *
+            * pointed by link or last used.                  *
+            **************************************************/
+            char *dir = NULL;
+            DIR *dirp;
+            struct dirent *dp;
+            struct timespec mtime = {0, 0};
+            regex_t preg;
+            char *pattern;
+            char *s, *p, *preselected_dir;
+
+        ;   if  (asprintf( &pattern, "^(%s|%s_[0-9a-zA-Z]{6})$"
+                         , pw->pw_name, pw->pw_name
+                         ) < 0
+                )
+            {   warn("###051 Can't asprintf pattern");                                       CONT(050)
+            }else if (exr(&preg, pattern, REG_EXTENDED | REG_NOSUB))                         CONT(051)
+        ;   free(pattern);
+        ;   if  (   cnfsum->tmpdirlink
+                &&  !lstat(cnfsum->tmpdirlink, &sb)
+                &&  !stat(cnfsum->tmpdirlink, &sb)
+                )
+            {   tmpdir_inod.d = sb.st_dev;
+        ;       tmpdir_inod.i = sb.st_ino;
+        ;   }else
+            {   tmpdir_inod.d = 0;;
+        ;       tmpdir_inod.i = 0;
+        ;   }
+            if  ((dir = (char*)malloc(strlen(cnfsum->tmpdir) + strlen(pw->pw_name) + 16)) == NULL)
+                                                                                             CONT(052)
+        ;   strcpy(dir, cnfsum->tmpdir);
+        ;   p = rindex(dir, '\0');
+        ;   if  ((dirp = (*dir ? opendir(dir) : opendir("/"))) == NULL)                      CONT(053)
+        ;   *p++ = '/';
+        ;   s = NULL;
+        ;   preselected_dir = NULL;
+        ;   while ((dp = readdir(dirp)) != NULL)
+            {   if  (regexec(&preg, dp->d_name, 0, NULL, 0) == 0)
+                {   strcpy(p, dp->d_name);
+        ;           if  (   !stat(dir, &sb)
+                        &&  ((sb.st_mode & (S_IFMT | S_IRWXU | S_IWGRP | S_IWOTH)) == (S_IFDIR | S_IRWXU))
+                        )
+                    {   if  (   (tmpdir_inod.d == sb.st_dev)
+                            &&  (tmpdir_inod.i == sb.st_ino)
+                            )
+                        {   link_ok = true;
+        ;                   preselected_dir = dp->d_name;
+        ;                   break;
+        ;               }else if (!strcmp(pw->pw_name, dp->d_name))
+                            preselected_dir = dp->d_name;
+                        else if (   (s == NULL)
+                                 ||  (mtime.tv_sec < sb.st_mtimespec.tv_sec)
+                                 ||  (   (mtime.tv_sec == sb.st_mtimespec.tv_sec)
+                                     &&  (mtime.tv_nsec < sb.st_mtimespec.tv_nsec)
+                                 )   )
+                        {   s = dp->d_name;
+        ;                   mtime.tv_sec = sb.st_mtimespec.tv_sec;
+        ;                   mtime.tv_nsec = sb.st_mtimespec.tv_nsec;
+        ;   }   }   }   }
+        ;   if (preselected_dir)
+                strcpy(p, preselected_dir);
+            else if (s)
+                strcpy(p, s);
+            else
+            {   strcpy(p, pw->pw_name);
+        ;       if  (mkdir(dir, 0700))
+                {   strcat(p, "_XXXXXX");
+        ;           if  (mkdtemp(dir) == NULL)                                               CONT(054)
+        ;   }   }
+        ;   if  (closedir(dirp))                                      warn("###054 Can't close dir?!");
+        ;   cnfsum->tmpdir = dir;
+        ;   cnfsum->user_subdir = false;
+        ;   if (stat(cnfsum->tmpdir, &sb))                                                   CONT(055)
+        }else if (stat(cnfsum->tmpdir, &sb))                                                 CONT(056)
+        else if (   (   (sb.st_mode & (S_IFMT | S_IRWXU | S_IWGRP | S_IWOTH))
+                    !=  (S_IFDIR | S_IRWXU)
+                    )
+                ||  (pw->pw_uid != sb.st_uid)
+                )                                                                            CONT(057)
+        tmpdir_inod.d = sb.st_dev;
+        tmpdir_inod.i = sb.st_ino;                                                /* END make TMPDIR */
+
+        if  (flag_v > 1) fprintf(stderr, "Change tmpdir=%s~\n", cnfsum->tmpdir);
+
+                                                                         /****************************/
+                                                                         /* BEGIN symlink TMPDIRLINK */
+        if  (cnfsum->tmpdir_linked)                                      /****************************/
+        {   char *t, *p = NULL;            /* TMPDIR reused due to link so link need not to be tuned */
+
+        ;   if (link_ok);
+            else if (!cnfsum->tmpdirlink)
+            {   fprintf(stderr, "%s: TMPDIR link need but not defined\n", myname);
+        ;       link_ok = false;                                                     which_error = 060;
+        ;   }else if (   ((p = strdup(cnfsum->tmpdirlink)) == NULL)
+                     ||  ((t = rindex(p, '/')) == NULL)
+                     ||  (*t = '\0', mk_dir(p))
+                     )
+            {   link_ok = false;                                                     which_error = 061;
+        ;   }else if (lstat(cnfsum->tmpdirlink, &sb))
+            {   link_ok = !symlink(cnfsum->tmpdir, cnfsum->tmpdirlink);
+        ;       if (!link_ok)                                                        which_error = 062;
+        ;   }else if (S_ISLNK(sb.st_mode))
+            {   link_ok = (   (  !stat(cnfsum->tmpdirlink, &sb)
+                              && (tmpdir_inod.d == sb.st_dev)
+                              && (tmpdir_inod.i == sb.st_ino)
+                              )
+                     /******************************************************************************
+                      * Do not know legal way to change symlink without delete.                    *
+                      * Removing and creation of symlink can fault due to directory permissions.   *
+                      * Posibility just to change symlink would avoid directory permissions issue. *
+                      * Yes, I know: no rights to change symlink without removing it.              *
+                      ******************************************************************************/
+                          ||  (  !unlink(cnfsum->tmpdirlink)
+                              && !symlink(cnfsum->tmpdir, cnfsum->tmpdirlink)
+                          )   );
+        ;       if (!link_ok)                                                        which_error = 063;
+        ;   }else
+            {    fprintf(stderr, "%s: Not symlink %s\n", myname, cnfsum->tmpdirlink);
+        ;        link_ok = false;                                                    which_error = 064;
+        ;   }
+        ;   if (p) free(p);
+        }else link_ok = true;
+        if  (!link_ok)
+        {   cnfsum->tmpdir_linked = false;
+            cnfsum->tmpdirlink = NULL;
+        }                                                                  /* END symlink TMPDIRLINK */
+
+        if (flag_v && which_error) fprintf(stderr, "***** ###067 Link failed #%03o\n", which_error);
+
+                                                                       /******************************/
+                                                                       /* BEGIN execute all rc files */
+        for (i = 2, st = 0; cnfsum->exec && !st && i >= 0; i--)        /******************************/
+        {   enum rcnames rc;
+            char *p;
+            int status;
+
+        ;   switch (i)
+            {default:
+        ;    case 2: rc = sysrc;   break;
+        ;    case 1: rc = userrc;  break;
+        ;    case 0: rc = forcerc; break;
+        ;   }
+        ;   if  (cnf[rc].actual && cnf[rc].script)
+            {   p = rindex(cnf[rc].fn, '/');
+        ;       if  (!(p++)) p = cnf[rc].fn;
+        ;       if (flag_v > 2) fprintf(stderr, "Execute %s %s\n", cnf[rc].fn, p);
+        ;       st = 0;
+        ;       set_env(cnfsum);
+        ;       switch (rfork(RFPROC | RFFDG))
+                {case -1:
+        ;           warn("Cant't fork to launch DELETED");
+        ;           break;
+        ;        case 0:
+        ;           execl(cnf[rc].fn, p, NULL);
+        ;           syslog(LOG_ERR | LOG_USER, "Can't execvp %s: %m\n", cnf[rc].fn);
+        ;           _exit(0);
+        ;        default:
+        ;           (void)wait(&status);
+        ;           st = WIFEXITED(status) ? WEXITSTATUS(status) : EX_UNAVAILABLE;
+        }   }   }
+        if (st) {if (flag_v) fprintf(stderr, "Execute error %d\n", st);                      CONT(077)}
+                                                                         /* END execute all rc files */
+
+
+                                                                      /*******************************/
+                                                                      /* BEGIN deleted daemon launch */
+        if  (cnfsum->tmpdir && cnfsum->deleted)                       /*******************************/
+        {   int i;
+            char *p;
+            char **arg;
+            struct deleted_arg *darg;
+
+        ;   i = 0;
+        ;   for (darg = cnfsum->deleted_args; darg; darg = darg->active)
+            {   if  (darg->name && *darg->name) i++;
+        ;       if  (darg->arg && *darg->arg) i++;
+        ;   }
+        ;   arg = (char**)malloc(sizeof(char**) * (i + 4));
+        ;   i = 0;
+        ;   p = rindex(cnfsum->deleted, '/');
+        ;   if  (p) arg[i++] = p + 1;
+            else arg[i++] = cnfsum->deleted;
+        ;   for (darg = cnfsum->deleted_args; darg; darg = darg->active)
+            {   if  (darg->name && *darg->name) arg[i++] = darg->name;
+        ;       if  (darg->arg && *darg->arg) arg[i++] = darg->arg;
+        ;   }
+        ;   arg[i++] = cnfsum->tmpdir;
+        ;   arg[i++] = NULL;
+        ;   set_env(cnfsum);
+        ;   if  (flag_v > 2)
+            {   fprintf(stderr, "Launch %s", cnfsum->deleted);
+        ;       for (i = 0; arg[i]; i++) fprintf(stderr, " %s", arg[i]);
+        ;       fprintf(stderr, "\n");
+        ;   }
+        ;   switch (rfork(RFPROC | RFNOWAIT | RFCFDG))
+            {case -1:
+        ;       warn("Cant't fork to launch DELETED");
+        ;       break;
+        ;    case 0:
+        ;       execvp(cnfsum->deleted, arg);
+        ;       syslog(LOG_ERR | LOG_USER, "Can't execvp %s: %m\n", cnfsum->deleted);
+        ;       _exit(0);
+        ;    default:;
+        }   }                                                           /* END deleted daemon launch */
+        printf("%s", cnfsum->tmpdir);
+        exit(EX_OK);
+}   }                                                                                     /* END Try */
--- usr.bin/Makefile
+++ usr.bin/Makefile
@@ -121,6 +121,7 @@
 	mkdep \
 	mkfifo \
 	mklocale \
+	mkinittmpdir \
 	${_mkstr} \
 	mktemp \
 	mkuzip \
