summarylogtreecommitdiffstats
path: root/xtreemfs-server.install
blob: f2a8243f2b7583f413274ea458fe0c023f30c763 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
XTREEMFS_GENERATE_UUID_SCRIPT="/etc/xos/xtreemfs/generate_uuid"

post_install() {
  if ! getent passwd xtreemfs >/dev/null
  then
    useradd -r -U -d /var/lib/xtreemfs -s /sbin/nologin xtreemfs
  fi

  chown -R xtreemfs:xtreemfs /var/lib/xtreemfs
  chown -R xtreemfs:xtreemfs /var/log/xtreemfs
  chown -R :xtreemfs /etc/xos/xtreemfs

  if [ -x "$XTREEMFS_GENERATE_UUID_SCRIPT" ]; then
      for conf in /etc/xos/xtreemfs/*.properties; do
          "$XTREEMFS_GENERATE_UUID_SCRIPT" "$conf"
      done
  else
      echo "UUID can't be generated automatically. Please enter a correct UUID in each config file of an XtreemFS service."
  fi
}