3ca66f2d28115fd516b2b4d960e84db96e861ddd
[mirrors/ArchLinux-Packages.git] / riak / riak.install
1 iuser=riak;
2 igroup="$iuser";
3 ihome="/opt/$iuser";
4 #iid="78";
5
6 # arg 1: the new package version
7 post_install() {
8 if [ -z "`grep '^$igroup::' /etc/group`" ]; then
9 groupadd "$igroup" >& /dev/null
10 fi
11 if [ -z "`grep '^$iuser:' /etc/passwd`" ]; then
12 useradd -d "$ihome" -g "$igroup" -s /bin/sh "$iuser"
13 fi
14
15 #chown -R "root:$igroup" "$ihome"
16 chown -R "$iuser:$igroup" "$ihome"
17 #chmod -R g+rw "$ihome"
18 chmod a+x "$ihome"
19 }
20
21 # arg 1: the new package version
22 # arg 2: the old package version
23 post_upgrade() {
24 post_install $1
25 }
26
27 # arg 1: the old package version
28 pre_remove() {
29 /etc/rc.d/riak stop &>/dev/null; sleep 1;
30 pkill -u "$iuser"
31 pkill -9 -u "$iuser"
32
33 chown -R "root:root" "$ihome"
34
35 userdel "$iuser" &> /dev/null
36 groupdel "$igroup" &> /dev/null
37 }
38
This page took 0.287892 seconds and 3 git commands to generate.