updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / riak / riak.install
blob77914c24a173cdb55ba0e2d04f3fb0df19b81ab3
1 iuser='riak'
2 igroup="$iuser"
3 ihome="/opt/$iuser"
5 # arg 1:  the new package version
6 post_install() {
7   if [ -z "$(grep '^$igroup:' /etc/group)" ]; then
8     groupadd "$igroup" >& /dev/null
9   fi
10   if [ -z "$(grep '^$iuser:' /etc/passwd)" ]; then
11     useradd -d "$ihome" -g "$igroup" -s /bin/sh "$iuser"
12   fi
14   #chown -R "root:$igroup" "$ihome"
15   chown -R "$iuser:$igroup" "$ihome"
16   #chmod -R g+rw "$ihome"
17   chmod a+x "$ihome"
19   if [ -e /opt/riak/etc/app.config.pacnew ] || [ -e /opt/riak/etc/vm.args.pacnew ]
20   then
21     ls /opt/riak/etc/*.pacnew
22     cat <<EOS
23 ==> WARNING! Riak configuration (or even storage backend) may changed since
24 ==> the last version, check http://basho.com/ for changelog...
25 EOS
26   fi
29 # arg 1:  the new package version
30 # arg 2:  the old package version
31 post_upgrade() {
32   post_install $1
35 # arg 1:  the old package version
36 pre_remove() {
37   /etc/rc.d/riak stop &>/dev/null; sleep 1;
38   pkill -u "$iuser"
39   pkill -9 -u "$iuser"
41   chown -R "root:root" "$ihome"
43   userdel "$iuser" &> /dev/null
44   #groupdel "$igroup" &> /dev/null