Changeset 3917


Ignore:
Timestamp:
Nov 6, 2007, 2:43:30 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #717: Make initdb, updatedb and other scripts accept a username

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/src/docbook/admindoc/installation_upgrade.xml

    r3903 r3917  
    229229            to <filename
    230230            class="directory">&lt;base-dir&gt;/bin/</filename> and issue
    231 <programlisting>sh ./updatedb.sh <emphasis>base_root_password</emphasis>
    232 sh ./updateindexes.sh <emphasis>base_root_password</emphasis></programlisting>
    233             where <emphasis>base_root_password</emphasis> is the
    234             password for the root user account within the BASE
    235             application.
     231<programlisting>
     232sh ./updatedb.sh [base_root_login] <emphasis>base_root_password</emphasis>
     233sh ./updateindexes.sh <emphasis>base_root_password</emphasis>
     234</programlisting>
     235            where <emphasis>base_root_login</emphasis> is the login
     236            for the root user and <emphasis>base_root_password</emphasis> is the
     237            password. The login is optional. If not specified,
     238            <constant>root</constant> is used as the login.
    236239          </para>
    237240        </listitem>
     
    932935            <filename class="directory">&lt;base-dir&gt;/bin</filename>
    933936            and run <filename>initdb.sh</filename> as
    934 <programlisting>./initdb.sh base_root_password</programlisting>
     937<programlisting>./initdb.sh [base_root_login] base_root_password</programlisting>
     938
    935939            <important>
    936             The <emphasis>base_root_password</emphasis> you use here
    937             is given to the BASE web application
    938             user <emphasis>root</emphasis>. There is no supported way
    939             to change the <emphasis>root</emphasis> account name.
     940            <para>
     941            The <emphasis>base_root_login</emphasis> and
     942            <emphasis>base_root_password</emphasis> you use here
     943            is given to the BASE web application root user account.
     944            The <emphasis>base_root_login</emphasis> is optional. If
     945            not specified, <constant>root</constant> is used for
     946            the login.
     947            </para>
    940948            </important>
    941949            If the initialisation script fail, it is most probably a
  • trunk/src/install/net/sf/basedb/install/InitDB.java

    r3857 r3917  
    5555      if ("install".equals(cmd) || "update".equals(cmd))
    5656      {
    57         if (args.length != 2)
     57        if (args.length < 2 && args.length > 3)
    5858        {
    5959          showUsage(cmd);
    6060          return;
    6161        }
    62         String rootPassword = args[1];
    63         String rootLogin = "root";
     62        String rootPassword = args.length == 3 ? args[2] : args[1];
     63        String rootLogin = args.length == 3 ? args[1] : "root";
    6464       
    6565        boolean update = "update".equals(cmd);
     
    7474        progress.setRange(95, 100);
    7575        progress.display(0, "Installing web application...");
    76         Webclient.install("root", rootPassword, "", "");
     76        Webclient.install(rootLogin, rootPassword, "", "");
    7777        progress.display(100, "Web application installed successfully.\n");
    7878      }
     
    128128    {
    129129      String script = "install".equals(cmd) ? "initdb.sh" : "updatedb.sh";
    130       System.out.println("Usage: "+script+" <root password>");
     130      System.out.println("Usage: "+script+" [root login] <root password>");
     131      System.out.println("       root login   : The login to use for the root user account");
    131132      System.out.println("       root password: The password to give to the root user account");
    132133    }
Note: See TracChangeset for help on using the changeset viewer.