Ignore:
Timestamp:
Nov 28, 2011, 2:42:42 PM (8 years ago)
Author:
hum@…
Message:

hadoop: add_hadoop_user_and_group in pre-active phase to fix binary installation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/java/hadoop/Portfile

    r84040 r87606  
    7575    reinplace "s|@hadoop_pid_dir@|${hadoop_pid_dir}|g" ${env_sh}
    7676
    77     # Add Hadoop user and group.
    78     addgroup ${hadoopuser}
    79     set gid [existsgroup ${hadoopuser}]
    80     adduser ${hadoopuser} \
    81         gid=${gid} \
    82         realname=Hadoop\ Server \
    83         home=${hadoop_var_dir} \
    84         shell=/bin/bash
     77    add_hadoop_user_and_group
    8578
    8679    # Create working directories.
     
    9386        ${destroot}${hadoop_log_dir} \
    9487        ${destroot}${hadoop_pid_dir}
     88}
     89
     90pre-activate {
     91    add_hadoop_user_and_group
     92}
     93
     94proc add_hadoop_user_and_group {} {
     95    global hadoopuser hadoop_var_dir
     96    if {![existsgroup ${hadoopuser}]} {
     97        addgroup ${hadoopuser}
     98        adduser ${hadoopuser} \
     99            gid=[existsgroup ${hadoopuser}] \
     100            realname=Hadoop\ Server \
     101            home=${hadoop_var_dir} \
     102            shell=/bin/bash
     103    }
    95104}
    96105
Note: See TracChangeset for help on using the changeset viewer.