View | Details | Raw Unified | Return to bug 104577 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-4 / +10 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	heartbeat
8
PORTNAME=	heartbeat
9
PORTVERSION=	1.2.4
9
PORTVERSION=	1.2.5
10
CATEGORIES=	sysutils
10
CATEGORIES=	sysutils
11
MASTER_SITES=	http://linux-ha.org/download/
11
MASTER_SITES=	http://linux-ha.org/download/
12
12
Lines 24-30 USE_GNOME= glib12 Link Here
24
USE_LDCONFIG=	yes
24
USE_LDCONFIG=	yes
25
25
26
CONFIGURE_ARGS+=	--disable-fatal-warnings \
26
CONFIGURE_ARGS+=	--disable-fatal-warnings \
27
			--with-initdir=${PREFIX}/etc/rc.d
27
			--with-initdir=${PREFIX}/etc/rc.d \
28
			--localstatedir=/var \
29
			--with-group-id=275 --with-ccmuser-id=275
28
30
29
SUB_FILES=	pkg-install
31
SUB_FILES=	pkg-install
30
PKGDEINSTALL=	${PKGINSTALL}
32
PKGDEINSTALL=	${PKGINSTALL}
Lines 63-73 post-patch: Link Here
63
		${WRKSRC}/telecom/cms/Makefile.in
65
		${WRKSRC}/telecom/cms/Makefile.in
64
.endif
66
.endif
65
67
68
.if !defined(BATCH)
69
BATCH=no
70
.endif
71
66
post-deinstall:
72
post-deinstall:
67
	@${SH} ${PKGINSTALL} ${PKGNAME} DEINSTALL
73
	@BATCH=${BATCH} ${SH} ${PKGINSTALL} ${PKGNAME} DEINSTALL
68
74
69
post-install:
75
post-install:
70
	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
76
	@BATCH=${BATCH} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
71
77
72
# some subdirs treat man as documentation, therefor we have to install
78
# some subdirs treat man as documentation, therefor we have to install
73
# those man pages manually if NOPORTDOCS is defined
79
# those man pages manually if NOPORTDOCS is defined
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (heartbeat-1.2.4.tar.gz) = 7e3f752af06c25f7141c4b67a538e718
1
MD5 (heartbeat-1.2.5.tar.gz) = d59b021af0e1cbaba56345cc67f6ef12
2
SHA256 (heartbeat-1.2.4.tar.gz) = cb2516a965582651859ab48a44dd8764332897ef9a81986a0aa25dc9306378cf
2
SHA256 (heartbeat-1.2.5.tar.gz) = 46f88a69324012317a4426dc93654ab28947b77675826686624d15cd5a4e357f
3
SIZE (heartbeat-1.2.4.tar.gz) = 2102978
3
SIZE (heartbeat-1.2.5.tar.gz) = 2107371
(-)pkg-plist (-3 / +3 lines)
Lines 271-276 sbin/supervise-ldirectord-config Link Here
271
@dirrmtry etc/ha.d/conf
271
@dirrmtry etc/ha.d/conf
272
@dirrmtry etc/ha.d
272
@dirrmtry etc/ha.d
273
@cwd /
273
@cwd /
274
@dirrmtry var/lib/heartbeat/ckpt
274
@dirrmtry var/lock/subsys
275
@dirrmtry var/lib/heartbeat/ccm
275
@dirrmtry var/lock
276
@dirrmtry var/lib/heartbeat
276
@dirrmtry var/lib
(-)files/pkg-install.in (-74 / +30 lines)
Lines 1-17 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
2
3
BATCH=${BATCH:=no}
4
base=%%PREFIX%%
5
6
ask() {
3
ask() {
7
    local question default answer
4
    local question default answer
8
5
9
    question=$1
6
    question=$1
10
    default=$2
7
    default=$2
11
    if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then
8
    # pkg_add fails anyhow, if we do not create the user/group
9
    if [ "x${BATCH}" = xno ]; then
12
	read -p "${question} [${default}]? " answer
10
	read -p "${question} [${default}]? " answer
13
    fi
11
    fi
14
    if [ x${answer} = x ]; then
12
    if [ "x${answer}" = x ]; then
15
	answer=${default}
13
	answer=${default}
16
    fi
14
    fi
17
    echo ${answer}
15
    echo ${answer}
Lines 33-58 yesno() { Link Here
33
}
31
}
34
32
35
make_account() {
33
make_account() {
36
    local u g gcos homeopt home
34
    local u g uid gid
37
35
38
    u=$1
36
    u=$1
39
    g=$2
37
    g=$2
40
    gcos=$3
38
    uid=$3
41
    homeopt=${4:+"-d $4"}
39
    gid=$4
42
40
43
    if pw group show "${g}" >/dev/null 2>&1; then
41
    if pw group show "${g}" >/dev/null 2>&1; then
44
	echo "You already have a group \"${g}\", so I will use it."
42
	echo "You already have a group \"${g}\", so I will use it."
45
    else
43
    else
46
	echo "You need a group \"${g}\"."
44
	echo "You need a group \"${g}\"."
47
	if which -s pw && yesno "Would you like me to create it" y; then
45
	if yesno "Would you like me to create it" y; then
48
	    pw groupadd ${g} || exit
46
	    pw groupadd ${g} -g ${gid} || exit
49
	    echo "Done."
47
	    echo "Done."
50
	else
48
	else
51
	    echo "Please create it, and try again."
49
	    echo "Please create it manually, and try again."
52
	    if ! grep -q "^${u}:" /etc/passwd; then
53
		echo "While you're at it, please create a user \"${u}\" too,"
54
		echo "with a default group of \"${g}\"."
55
	    fi
56
	    exit 1
50
	    exit 1
57
	fi
51
	fi
58
    fi
52
    fi
Lines 61-150 make_account() { Link Here
61
	echo "You already have a user \"${u}\", so I will use it."
55
	echo "You already have a user \"${u}\", so I will use it."
62
    else
56
    else
63
	echo "You need a user \"${u}\"."
57
	echo "You need a user \"${u}\"."
64
	if which -s pw && yesno "Would you like me to create it" y; then
58
	if yesno "Would you like me to create it" y; then
65
	    pw useradd ${u} -g ${g} -h - ${homeopt} \
59
	    pw useradd ${u} -u ${uid} -g ${g} -h - -d /nonexistant \
66
		-s /nonexistent -c "${gcos}" || exit
60
		-s /sbin/nologin -c "Heartbeat cluster user" || exit
67
	    echo "Done."
61
	    echo "Done."
68
	else
62
	else
69
	    echo "Please create it, and try again."
63
	    echo "Please create it, and try again."
70
	    exit 1
64
	    exit 1
71
	fi
65
	fi
72
    fi
66
    fi
73
74
    if [ x"$homeopt" = x ]; then
75
	eval home=~${u}
76
	if [ ! -d "${home}" ]; then
77
	    if yesno \
78
		"Would you like me to create ${u}'s home directory (${home})" y
79
	    then
80
		mkdir -p ${home} || exit
81
		chown -R ${u}:${g} ${home} || exit
82
		chmod -R go= ${home} || exit
83
	    else
84
		echo "Please create it, and try again."
85
		exit 1
86
	    fi
87
	fi
88
    fi
89
}
67
}
90
68
91
delete_account() {
69
delete_account() {
92
    local u g home
70
    local u g
93
71
94
    u=$1
72
    u=$1
95
    g=$2
73
    g=$2
96
    if yesno "Do you want me to remove group \"${g}\"" y; then
74
    if yesno "Do you want me to remove group \"${g}\"" y; then
75
	echo "Removing group \"${g}\""
97
        pw groupdel -n ${g}
76
        pw groupdel -n ${g}
98
        echo "Done."
77
        echo "Done."
99
    fi
78
    fi
100
    if yesno "Do you want me to remove user \"${u}\"" y; then
79
    if yesno "Do you want me to remove user \"${u}\"" y; then
101
        eval home=~${u}
80
	echo "Removing user \"${u}\""
102
        pw userdel -n ${u}
81
        pw userdel -n ${u}
103
        echo "Done."
82
        echo "Done."
104
        if [ -d "${home}" ]; then
105
            echo "Please remember to remove the home directory \"${home}\" as"
106
            echo "well as the mirrored files."
107
        fi
108
    fi
83
    fi
109
}
84
}
110
85
111
case $2 in
86
case $2 in
112
87
113
POST-INSTALL)
88
POST-INSTALL)
114
    if which -s pw && which -s lockf; then
115
	:
116
    else
117
	cat <<EOF
118
119
This system looks like a pre-2.2 version of FreeBSD.  I see that it
120
is missing the "lockf" and/or "pw" utilities.  I need these utilities.
121
Please get them and install them, and try again.  You can get the
122
sources from:
123
124
  ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.bin/lockf.tar.gz
125
  ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz
126
127
EOF
128
	exit 1
129
    fi
130
131
    echo ""
89
    echo ""
132
    user=hacluster
90
    user=hacluster
133
    group=haclient
91
    group=haclient
134
    make_account ${user} ${group} "${user} ${group}" "/nonexistent"
92
    uid=275
93
    gid=275
94
    make_account ${user} ${group} $uid $gid
135
95
136
    echo "Adding empty dirs and pid file."
96
    echo "Adding empty dirs and pid file."
137
    test -d ${base}/var/lib/heartbeat/ckpt || \
97
    test -d /var/lib/heartbeat/ckpt || \
138
            install -d -m 755 ${base}/var/lib/heartbeat/ckpt
98
            install -d -m 755 /var/lib/heartbeat/ckpt
139
    test -d ${base}/var/lib/heartbeat/ccm || \
99
    test -d /var/lock/subsys || \
140
            install -d -m 755 ${base}/var/lib/heartbeat/ccm
100
            install -d -m 755 /var/lock/subsys
141
    test -d ${base}/var/lock/subsys || \
101
    test -f /var/run/heartbeat.pid || \
142
            install -d -m 755 ${base}/var/lock/subsys
143
    test -d ${base}/etc/ha.d/conf || \
144
            install -d -m 755 ${base}/etc/ha.d/conf
145
    test -f ${base}/var/run/heartbeat.pid || \
146
            install -m 644 -o ${user} -g ${group} /dev/null \
102
            install -m 644 -o ${user} -g ${group} /dev/null \
147
                ${base}/var/run/heartbeat.pid
103
                /var/run/heartbeat.pid
148
    ;;
104
    ;;
149
105
150
DEINSTALL)
106
DEINSTALL)
Lines 161-174 DEINSTALL) Link Here
161
    delete_account hacluster haclient
117
    delete_account hacluster haclient
162
118
163
    echo "Removing runtime files"
119
    echo "Removing runtime files"
164
    if [ -d ${base}/var/lib/heartbeat ]; then
120
    if [ -d /var/lib/heartbeat ]; then
165
        rm -r ${base}/var/lib/heartbeat
121
        rm -r /var/lib/heartbeat
166
    fi
122
    fi
167
    if [ -f ${base}/var/lock/subsys/heartbeat ]; then
123
    if [ -f /var/lock/subsys/heartbeat ]; then
168
        rm ${base}/var/lock/subsys/heartbeat
124
        rm /var/lock/subsys/heartbeat
169
    fi
125
    fi
170
    if [ -f ${base}/var/run/heartbeat.pid ]; then
126
    if [ -f /var/run/heartbeat.pid ]; then
171
        rm ${base}/var/run/heartbeat.pid
127
        rm /var/run/heartbeat.pid
172
    fi
128
    fi
173
    ;;
129
    ;;
174
esac
130
esac

Return to bug 104577