File: node.sh.in

package info (click to toggle)
oar 2.5.4-2
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 11,064 kB
  • sloc: perl: 28,891; ruby: 5,813; sh: 5,208; ml: 3,408; sql: 3,255; cpp: 2,277; ansic: 702; makefile: 389; php: 99; exp: 23
file content (64 lines) | stat: -rw-r--r-- 1,928 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
install_ssh_host_keys() {
    if [ ! -r ${OARCONFDIR}/oar_ssh_host_rsa_key ]; then 
        rm -f ${OARCONFDIR}/oar_ssh_host_rsa_key.pub

        if [ -e "${ETCDIR}/ssh/ssh_host_rsa_key" ]; then
            install_if_not_exist \
                ${ETCDIR}/ssh/ssh_host_rsa_key \
                ${OARCONFDIR}/oar_ssh_host_rsa_key \
                0600
        
            install_if_not_exist \
                ${ETCDIR}/ssh/ssh_host_rsa_key.pub \
                ${OARCONFDIR}/oar_ssh_host_rsa_key.pub 
        fi

    fi

    if [ ! -r ${OARCONFDIR}/oar_ssh_host_dsa_key ]; then 
        rm -f ${OARCONFDIR}/oar_ssh_host_dsa_key.pub 

        if [ -e "${ETCDIR}/ssh/ssh_host_dsa_key" ]; then
            install_if_not_exist \
                ${ETCDIR}/ssh/ssh_host_dsa_key \
                ${OARCONFDIR}/oar_ssh_host_dsa_key \
                0600

            install_if_not_exist \
                ${ETCDIR}/ssh/ssh_host_dsa_key.pub \
                ${OARCONFDIR}/oar_ssh_host_dsa_key.pub
        fi 
    fi

    if [ ! "-d ${VARLIBDIR}/oar/.ssh/id_rsa" ] && [ ! "-d ${VARLIBDIR}/oar/.ssh/id_dsa" ]; then
        echo "
    ##########################################################################
    # node #
    ########
    #   You need to install the ssh keys (private and public) of the oar user
    #   into ${VARLIBDIR}/oar/.ssh.
    #   A common way is to copy the entire .ssh directory from the server on 
    #   all the nodes of your cluster.
    ##########################################################################
    "
    fi
}

node_setup() {
    install_conffile \
        ${SHAREDIR}/epilogue \
        ${OARCONFDIR}/epilogue \
        0755
    
    install_conffile \
        ${SHAREDIR}/prologue \
        ${OARCONFDIR}/prologue \
        0755

    install_conffile \
        ${SHAREDIR}/sshd_config \
        ${OARCONFDIR}/sshd_config \
        0600 ${OAROWNER}

    install_ssh_host_keys
}