Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > af10ba966738d9fb4cf3c8f997b8b401 > scriptlet

flumotion-0.6.1-2.fc14.i686.rpm

PREIN

/bin/sh
/usr/sbin/useradd -s /sbin/nologin \
        -r -d /var/cache/flumotion -M \
        flumotion > /dev/null 2> /dev/null || :
# for old installs, we need to move the homedir
/usr/sbin/usermod -d /var/cache/flumotion \
        flumotion > /dev/null 2> /dev/null || :

PREUN

/bin/sh
# if removal and not upgrade, stop the processes, clean up locks
if [ $1 -eq 0 ]
then
  /sbin/service flumotion stop > /dev/null

  rm -rf /var/lock/flumotion*
  rm -rf /var/run/flumotion*

  # clean out the cache/home dir too, without deleting it or the user
  rm -rf /var/cache/flumotion/*
  rm -rf /var/cache/flumotion/.[^.]*

  /sbin/chkconfig --del flumotion
fi

# Think about this first, we don't really want to stop everything
#%postun
# if [ $1 -ge 1 ]; then
#   /sbin/service flumotion condrestart
# fi

POSTIN

/bin/sh
/sbin/chkconfig --add flumotion
# generate a default .pem certificate ?
PEM_FILE="/etc/flumotion/default.pem"
if ! test -e ${PEM_FILE}
then
  sh /usr/share/flumotion/make-dummy-cert ${PEM_FILE}
  chown :flumotion ${PEM_FILE}
  chmod 640 ${PEM_FILE}
fi

# create a default planet config if no manager configs present
# the default login will be user/test
if ! test -e /etc/flumotion/managers
then
  mkdir -p /etc/flumotion/managers/default/flows
  cat > /etc/flumotion/managers/default/planet.xml <<EOF
<planet>
 
  <manager>
    <!-- <debug>3</debug> -->
    <host>localhost</host>
<!--
    <port>7531</port>
    <transport>ssl</transport>
-->
    <!-- certificate path can be relative to $sysconfdir/flumotion,
         or absolute -->
<!--
    <certificate>default.pem</certificate>
-->
    <component name="manager-bouncer" type="htpasswdcrypt-bouncer">
      <property name="data"><![CDATA[
user:PSfNpHTkpTx1M
]]></property>
    </component>
  </manager>
 
</planet>
EOF
fi

# create a default worker config if no worker configs present
# the default login will be user/test
if ! test -e /etc/flumotion/workers
then
  mkdir -p /etc/flumotion/workers
  cat > /etc/flumotion/workers/default.xml <<EOF
<worker>
 
  <!-- <debug>3</debug> -->

  <manager>
<!--
    <host>localhost</host>
    <port>7531</port>
-->
  </manager>

  <authentication type="plaintext">
    <username>user</username>
    <password>test</password>
  </authentication>

  <!-- <feederports>8600-8639</feederports> -->
 
</worker>
EOF

fi