You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Ingo Rauschenberg (JIRA)" <ji...@apache.org> on 2012/10/31 15:11:12 UTC

[jira] [Created] (HADOOP-8997) Upgrade of the .deb Packege removes Hadoop Users (hdfs and mapred) and the hadoop-group

Ingo Rauschenberg created HADOOP-8997:
-----------------------------------------

             Summary: Upgrade of the .deb Packege removes Hadoop Users (hdfs and mapred) and the hadoop-group
                 Key: HADOOP-8997
                 URL: https://issues.apache.org/jira/browse/HADOOP-8997
             Project: Hadoop Common
          Issue Type: Bug
    Affects Versions: 1.0.4, 1.0.3
         Environment: Debian Squeeze 64 Bit
            Reporter: Ingo Rauschenberg


During the Package Upgrade the script postrm from the old package is the last script that is called.
Because this script is called after the preinst-script of the new package is called the Haddop users and group is deleted.

This happens because the Script don't check the parameter which is given to him.

A solution may be to modify the script:
#! /bin/sh

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Abort if any command returns an error value
set -e

# This script is called twice during the removal of the package; once
# after the removal of the package's files from the system, and as
# the final step in the removal of this package, after the package's
# conffiles have been removed.

case "$1" in
  remove)
    # This package has been removed, but its configuration has not yet
    # been purged.
    /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
    /usr/sbin/userdel mapred 2> /dev/null >/dev/null
    /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
    ;;
  purge)
    # This package has previously been removed and is now having
    # its configuration purged from the system.
    /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
    /usr/sbin/userdel mapred 2> /dev/null >/dev/null
    /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
    ;;
  disappear)
    if test "$2" != overwriter; then
      echo "$0: undocumented call to \`postrm $*'" 1>&2
      exit 1
    fi
    # This package has been completely overwritten by package $3
    # (version $4).  All our files are already gone from the system.
    # This is a special case: neither "prerm remove" nor "postrm remove"
    # have been called, because dpkg didn't know that this package would
    # disappear until this stage.
    :
    ;;
  upgrade)
    # About to upgrade FROM THIS VERSION to version $2 of this package.
    # "prerm upgrade" has been called for this version, and "preinst
    # upgrade" has been called for the new version.  Last chance to
    # clean up.
    :
    ;;
  failed-upgrade)
    # About to upgrade from version $2 of this package TO THIS VERSION.
    # "prerm upgrade" has been called for the old version, and "preinst
    # upgrade" has been called for this version.  This is only used if
    # the previous version's "postrm upgrade" couldn't handle it and
    # returned non-zero. (Fix old postrm bugs here.)
    :
    ;;
  abort-install)
    # Back out of an attempt to install this package.  Undo the effects of
    # "preinst install...".  There are two sub-cases.
    /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
    /usr/sbin/userdel mapred 2> /dev/null >/dev/null
    /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
    if test "${2+set}" = set; then
      # When the install was attempted, version $2's configuration
      # files were still on the system.  Undo the effects of "preinst
      # install $2".
      :
    else
      # We were being installed from scratch.  Undo the effects of
      # "preinst install".
      :
    fi ;;
  abort-upgrade)
    # Back out of an attempt to upgrade this package from version $2
    # TO THIS VERSION.  Undo the effects of "preinst upgrade $2".
    :
    ;;
  *) echo "$0: didn't understand being called with \`$1'" 1>&2
     exit 1;;
esac

exit 0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-8997) Upgrade of the .deb Packege removes Hadoop Users (hdfs and mapred) and the hadoop-group

Posted by "Ingo Rauschenberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487809#comment-13487809 ] 

Ingo Rauschenberg commented on HADOOP-8997:
-------------------------------------------

Sorry, the script-code that i have pasted in the description looks like a autoformat trigger has ruined it :(
                
> Upgrade of the .deb Packege removes Hadoop Users (hdfs and mapred) and the hadoop-group
> ---------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8997
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8997
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 1.0.3, 1.0.4
>         Environment: Debian Squeeze 64 Bit
>            Reporter: Ingo Rauschenberg
>
> During the Package Upgrade the script postrm from the old package is the last script that is called.
> Because this script is called after the preinst-script of the new package is called the Haddop users and group is deleted.
> This happens because the Script don't check the parameter which is given to him.
> A solution may be to modify the script:
> #! /bin/sh
> # Licensed to the Apache Software Foundation (ASF) under one or more
> # contributor license agreements.  See the NOTICE file distributed with
> # this work for additional information regarding copyright ownership.
> # The ASF licenses this file to You under the Apache License, Version 2.0
> # (the "License"); you may not use this file except in compliance with
> # the License.  You may obtain a copy of the License at
> #
> #     http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
> # Abort if any command returns an error value
> set -e
> # This script is called twice during the removal of the package; once
> # after the removal of the package's files from the system, and as
> # the final step in the removal of this package, after the package's
> # conffiles have been removed.
> case "$1" in
>   remove)
>     # This package has been removed, but its configuration has not yet
>     # been purged.
>     /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
>     /usr/sbin/userdel mapred 2> /dev/null >/dev/null
>     /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
>     ;;
>   purge)
>     # This package has previously been removed and is now having
>     # its configuration purged from the system.
>     /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
>     /usr/sbin/userdel mapred 2> /dev/null >/dev/null
>     /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
>     ;;
>   disappear)
>     if test "$2" != overwriter; then
>       echo "$0: undocumented call to \`postrm $*'" 1>&2
>       exit 1
>     fi
>     # This package has been completely overwritten by package $3
>     # (version $4).  All our files are already gone from the system.
>     # This is a special case: neither "prerm remove" nor "postrm remove"
>     # have been called, because dpkg didn't know that this package would
>     # disappear until this stage.
>     :
>     ;;
>   upgrade)
>     # About to upgrade FROM THIS VERSION to version $2 of this package.
>     # "prerm upgrade" has been called for this version, and "preinst
>     # upgrade" has been called for the new version.  Last chance to
>     # clean up.
>     :
>     ;;
>   failed-upgrade)
>     # About to upgrade from version $2 of this package TO THIS VERSION.
>     # "prerm upgrade" has been called for the old version, and "preinst
>     # upgrade" has been called for this version.  This is only used if
>     # the previous version's "postrm upgrade" couldn't handle it and
>     # returned non-zero. (Fix old postrm bugs here.)
>     :
>     ;;
>   abort-install)
>     # Back out of an attempt to install this package.  Undo the effects of
>     # "preinst install...".  There are two sub-cases.
>     /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
>     /usr/sbin/userdel mapred 2> /dev/null >/dev/null
>     /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
>     if test "${2+set}" = set; then
>       # When the install was attempted, version $2's configuration
>       # files were still on the system.  Undo the effects of "preinst
>       # install $2".
>       :
>     else
>       # We were being installed from scratch.  Undo the effects of
>       # "preinst install".
>       :
>     fi ;;
>   abort-upgrade)
>     # Back out of an attempt to upgrade this package from version $2
>     # TO THIS VERSION.  Undo the effects of "preinst upgrade $2".
>     :
>     ;;
>   *) echo "$0: didn't understand being called with \`$1'" 1>&2
>      exit 1;;
> esac
> exit 0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-8997) Upgrade of the .deb Packege removes Hadoop Users (hdfs and mapred) and the hadoop-group

Posted by "Harsh J (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487866#comment-13487866 ] 

Harsh J commented on HADOOP-8997:
---------------------------------

Hi Ingo,

Thanks much for taking time to file this bug and provide a solution.

However, the project has decided to not self-support and to actually delegate the packaging work over to Apache Bigtop (Resides at http://incubator.apache.org/bigtop/ but has graduated from Incubator already).

Could you try to reproduce the issue on the Bigtop Hadoop 1.x/2.x packages and file a BIGTOP JIRA if it is still relevant. From recent memory and experience in using derived packages from there, I don't think it removes the users or groups. But would be good if you can try out the same scenario over it and report over there.

Thanks!,
Harsh
                
> Upgrade of the .deb Packege removes Hadoop Users (hdfs and mapred) and the hadoop-group
> ---------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8997
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8997
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 1.0.3, 1.0.4
>         Environment: Debian Squeeze 64 Bit
>            Reporter: Ingo Rauschenberg
>
> During the Package Upgrade the script postrm from the old package is the last script that is called.
> Because this script is called after the preinst-script of the new package is called the Haddop users and group is deleted.
> This happens because the Script don't check the parameter which is given to him.
> A solution may be to modify the script:
> #! /bin/sh
> # Licensed to the Apache Software Foundation (ASF) under one or more
> # contributor license agreements.  See the NOTICE file distributed with
> # this work for additional information regarding copyright ownership.
> # The ASF licenses this file to You under the Apache License, Version 2.0
> # (the "License"); you may not use this file except in compliance with
> # the License.  You may obtain a copy of the License at
> #
> #     http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
> # Abort if any command returns an error value
> set -e
> # This script is called twice during the removal of the package; once
> # after the removal of the package's files from the system, and as
> # the final step in the removal of this package, after the package's
> # conffiles have been removed.
> case "$1" in
>   remove)
>     # This package has been removed, but its configuration has not yet
>     # been purged.
>     /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
>     /usr/sbin/userdel mapred 2> /dev/null >/dev/null
>     /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
>     ;;
>   purge)
>     # This package has previously been removed and is now having
>     # its configuration purged from the system.
>     /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
>     /usr/sbin/userdel mapred 2> /dev/null >/dev/null
>     /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
>     ;;
>   disappear)
>     if test "$2" != overwriter; then
>       echo "$0: undocumented call to \`postrm $*'" 1>&2
>       exit 1
>     fi
>     # This package has been completely overwritten by package $3
>     # (version $4).  All our files are already gone from the system.
>     # This is a special case: neither "prerm remove" nor "postrm remove"
>     # have been called, because dpkg didn't know that this package would
>     # disappear until this stage.
>     :
>     ;;
>   upgrade)
>     # About to upgrade FROM THIS VERSION to version $2 of this package.
>     # "prerm upgrade" has been called for this version, and "preinst
>     # upgrade" has been called for the new version.  Last chance to
>     # clean up.
>     :
>     ;;
>   failed-upgrade)
>     # About to upgrade from version $2 of this package TO THIS VERSION.
>     # "prerm upgrade" has been called for the old version, and "preinst
>     # upgrade" has been called for this version.  This is only used if
>     # the previous version's "postrm upgrade" couldn't handle it and
>     # returned non-zero. (Fix old postrm bugs here.)
>     :
>     ;;
>   abort-install)
>     # Back out of an attempt to install this package.  Undo the effects of
>     # "preinst install...".  There are two sub-cases.
>     /usr/sbin/userdel hdfs 2> /dev/null >/dev/null
>     /usr/sbin/userdel mapred 2> /dev/null >/dev/null
>     /usr/sbin/groupdel hadoop 2> /dev/null >dev/null
>     if test "${2+set}" = set; then
>       # When the install was attempted, version $2's configuration
>       # files were still on the system.  Undo the effects of "preinst
>       # install $2".
>       :
>     else
>       # We were being installed from scratch.  Undo the effects of
>       # "preinst install".
>       :
>     fi ;;
>   abort-upgrade)
>     # Back out of an attempt to upgrade this package from version $2
>     # TO THIS VERSION.  Undo the effects of "preinst upgrade $2".
>     :
>     ;;
>   *) echo "$0: didn't understand being called with \`$1'" 1>&2
>      exit 1;;
> esac
> exit 0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira