File: node.sh.in

package info (click to toggle)
oar 2.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,700 kB
  • sloc: perl: 34,517; sh: 6,041; ruby: 5,840; sql: 3,390; cpp: 2,277; makefile: 402; php: 365; ansic: 335; python: 275; exp: 23
file content (75 lines) | stat: -rw-r--r-- 2,230 bytes parent folder | download
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
65
66
67
68
69
70
71
72
73
74
75
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}/oar-node-service \
        ${OARCONFDIR}/oar-node-service \
        0755

    install_conffile \
        ${SHAREDIR}/pam_oar_adopt.conf \
        ${OARCONFDIR}/pam_oar_adopt.conf \
        0644

    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
    install -d -o ${OAROWNER} -g ${OAROWNERGROUP} -m 0755 ${OARHOMEDIR}/checklogs
}