Lines 44-51
Link Here
|
44 |
S=${WORKDIR}/${MY_P} |
44 |
S=${WORKDIR}/${MY_P} |
45 |
|
45 |
|
46 |
pkg_setup() { |
46 |
pkg_setup() { |
47 |
enewgroup mongodb |
47 |
if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then |
48 |
enewuser mongodb -1 -1 /var/lib/${PN} mongodb |
48 |
ewarn "!! ERROR !!" |
|
|
49 |
ewarn "You cannot directly upgrade a mongodb version 2.x" |
50 |
ewarn "deployment to ${PN}-${PV}. Instead, you must upgrade" |
51 |
ewarn "to a 3.0.x version first and then upgrade that to" |
52 |
ewarn "${PN}-${PV}. " |
53 |
ewarn " " |
54 |
ewarn "Terminating ebuild." |
55 |
die "Terminating ebuild." |
56 |
fi |
57 |
|
58 |
# Determine if a mongod is running at this time |
59 |
# Issue warning and die if server is running. |
60 |
|
61 |
ps -A | grep -q '[m]ongod' |
62 |
if [ "$?" -eq "0" ]; then |
63 |
ewarn "!! ERROR!!" |
64 |
ewarn "You must shut down the running mongod server" |
65 |
ewarn "before continuing with this ebuild." |
66 |
ewarn "Shut down the mongod server and try again." |
67 |
die "Terminating ebuild." |
68 |
fi |
69 |
|
70 |
# If the user mongodb already exists we do not neeed |
71 |
# to add these users to the system. If the user and |
72 |
# group do not exist, we create them. |
73 |
|
74 |
getent group mongodb > /dev/null 2&>1 |
75 |
|
76 |
if [ "$?" -eq "1" ]; then |
77 |
enewgroup mongodb |
78 |
fi |
79 |
|
80 |
getent passwd mongodb > /dev/null 2&>1 |
81 |
|
82 |
if [ "$?" -eq "1" ]; then |
83 |
enewuser mongodb -1 -1 /var/lib/${PN} mongodb |
84 |
fi |
49 |
|
85 |
|
50 |
# Maintainer notes |
86 |
# Maintainer notes |
51 |
# |
87 |
# |
Lines 140-159
Link Here
|
140 |
} |
176 |
} |
141 |
|
177 |
|
142 |
pkg_postinst() { |
178 |
pkg_postinst() { |
143 |
if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then |
179 |
ewarn "!! IMPORTANT !!" |
144 |
ewarn "!! IMPORTANT !!" |
180 |
ewarn " " |
145 |
ewarn " " |
181 |
ewarn "Make sure you check your configuration file in /etc/${PN}.conf" |
146 |
ewarn "${PN} configuration files have changed !" |
182 |
ewarn "For more information about configuration options, see:" |
147 |
ewarn " " |
183 |
ewarn " " |
148 |
ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf" |
184 |
ewarn " https://docs.mongodb.org/manual/reference/configuration-options/" |
149 |
ewarn " http://docs.mongodb.org/manual/reference/configuration-options/" |
185 |
ewarn " " |
150 |
ewarn " " |
186 |
ewarn "If upgrading from an older deployment of ${PN}, Make sure you also follow" |
151 |
ewarn "Make sure you also follow the upgrading process :" |
187 |
ewarn "the upgrading process :" |
152 |
ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/" |
188 |
ewarn " https://docs.mongodb.org/manual/release-notes/3.2-upgrade/" |
153 |
ewarn " " |
189 |
ewarn " " |
154 |
ewarn "MongoDB 3.0 introduces the WiredTiger storage engine." |
190 |
ewarn "MongoDB 3.2 uses the WiredTiger storage engine by default for new deployments. For" |
155 |
ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it." |
191 |
ewarn "existing deployments in the version 3.0 series, MongoDB 3.2 will use the mmapv1 " |
156 |
ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf" |
192 |
ewarn "storage engine if your existing databases were created with it. If you want to convert" |
157 |
ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger" |
193 |
ewarn "from the mmapv1 storage engine to WiredTiger, you will need to dump your databases" |
158 |
fi |
194 |
ewarn "with mongodump. Set the storage engine and specify a new dbpath in /etc/${PN}.conf." |
|
|
195 |
ewarn "Create the dbpath and chmod it so that user mongodb has owner and group rwx permissions." |
196 |
ewarn "You may also want to change the name of the logfile that mongod writes to." |
197 |
ewarn " " |
198 |
ewarn " https://docs.mongodb.org/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger" |
199 |
ewarn " " |
200 |
ewarn "After emerging this package, remember to start the mongod server again. If needed, " |
201 |
ewarn "restore databases with mongorestore." |
159 |
} |
202 |
} |