LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-18-2012, 09:20 PM   #1
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Rep: Reputation: 108Reputation: 108
Debian wheezy(amd64): fail to configure tzdata -> everything got stuck.


Hya,

situation
This week, after dist-upgrade,
Code:
Setting up tzdata (2012c-1) ...          
dpkg: error processing tzdata (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 tzdata
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up tzdata (2012c-1) ...
dpkg: error processing tzdata (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 tzdata
and many other things got stuck.

This happened with 2 penguins (amd64 wheezy).

I have checked 1. bug report for tzdata, dpkg, 2. changelog for tzdata (2012c-1), 3. aptitude with -v option. So far, no solution.

These two penguins have different apt source files.

The file (tzdata) is a kind of essential and I have not tried to remove (purge) and install.

Question
How can I get out of this situation?

Closing remark
Thanks in advance.
 
Old 06-19-2012, 12:55 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

you should try to debug the post-installation script and work out why it is returning with non-zero status. You can find it at:

/var/lib/dpkg/info/tzdata.postinst

Try putting 'set -x' on the second line of the script, then run 'dpkg --configure tzdata'.

Cheers,

Evo2.
 
Old 06-19-2012, 02:28 AM   #3
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Original Poster
Rep: Reputation: 108Reputation: 108
Hya

After setting "set -x" on the second line, "dpkg --configure tzdata" runs without error, (exit status is 0). I am not sure what went on, however, no error.

Then, things look well.

Hopefully, no hidden trouble in future.

Thanks.

Have a nice Penguin!
 
Old 06-19-2012, 03:02 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

hmm maybe I know. Did you delete a line with "set -e"? A "set -e" would have caused the script to exit if any of the commands it runs run turn non-zero. If this is the case something may have failed to be setup correctly. If you did delete it please add "set -x" and "set -e" and rerun the configuration.

Evo2.
 
Old 06-19-2012, 07:50 PM   #5
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Original Poster
Rep: Reputation: 108Reputation: 108
Auch,

You are a star! How did you know that I deleted the line "set -e"?
With "set -x" on line 2, it goes like
Code:
.
.
+ mv -f /etc/localtime.dpkg-new /etc/localtime
+ which restorecon
+ restorecon /etc/localtime
dpkg: error processing tzdata (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 tzdata
#
and I guess "which restorecon >/dev/null 2>&1 && restorecon /etc/localtime" is where the Penguin chokes. However
Code:
# which restorecon
/sbin/restorecon
# echo $?
0
# restorecon /etc/localtime
# echo $?
0
#
The content of '/etc/localtime' looks correct.

Apology for my poor experience with sh script.

Thanks for your assistance.
 
Old 06-19-2012, 07:58 PM   #6
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Original Poster
Rep: Reputation: 108Reputation: 108
And entire tzdata.postinst looks like
Code:
# cat tzdata.postinst 
#! /bin/sh
set -x
set -e

LC_ALL=C
LANG=C
unset TZ
umask 022

. /usr/share/debconf/confmodule
db_version 2.0

if [ "$1" = configure ]; then
    # If the user prefers to manage the time zone by itself, let him doing that.

    if ! [ -e /etc/timezone ] && [ -z "$DEBCONF_RECONFIGURE" ] ; then
        db_stop
        echo
        echo "User defined time zone, leaving /etc/localtime unchanged."
    else
    
        # Get the values from debconf
        AREA=Etc
        ZONE=UTC
        db_get tzdata/Areas && AREA="$RET"
        db_get tzdata/Zones/$AREA && ZONE="$RET"
        db_stop
    
        # Update the time zone
        echo $AREA/$ZONE > /etc/timezone
        cp -f /usr/share/zoneinfo/$AREA/$ZONE /etc/localtime.dpkg-new && \
            mv -f /etc/localtime.dpkg-new /etc/localtime
        which restorecon >/dev/null 2>&1 && restorecon /etc/localtime
    
        echo 
        echo "Current default time zone: '$AREA/$ZONE'"
    fi

    # Show the new setting to the user
    TZBase=$(LC_ALL=C TZ=UTC0 date)
    UTdate=$(LC_ALL=C TZ=UTC0 date -d "$TZBase")
    TZdate=$(unset TZ ; LANG=C date -d "$TZBase")
    echo "Local time is now:      $TZdate."
    echo "Universal Time is now:  $UTdate."
    if [ -z "$DEBCONF_RECONFIGURE" ] ; then
        echo "Run 'dpkg-reconfigure tzdata' if you wish to change it."
    fi
    echo
fi



exit 0
 
Old 06-20-2012, 02:01 AM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

this is a little strange I wonder if it is shell related. If /bin/sh is not linked to your login shell, can you please try changing the "#! /bin/sh" to "#! /bin/bash" and try again?

Another thing is that restorecon seems to be SELinux related (from the policycoreutils package): are you actually using SELinux? If not, you should probably remove policycoreutils. I guess simply commenting out that line in the postinst script will work for you (if you don't use selinux), but it doesn't answer the underlying question.

Looking like it could be time to think about filing a but report.

Evo2.
 
Old 06-22-2012, 06:19 AM   #8
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Original Poster
Rep: Reputation: 108Reputation: 108
Hya,

Sorry for delay, I was off several days.

1. /bin/sh to /bin/bash does not change anything.

2. neither removing policycoreutils.

It may be a good idea to file bug report, I agree. However, I am not sure which one of tzdata or selinux (policycoreutils) is to blame. I will try to pinpoint a little further.

cheers
 
Old 06-28-2012, 09:08 PM   #9
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Original Poster
Rep: Reputation: 108Reputation: 108
Hya,

Self reply:

Two other amd64 Penguins and two ia32 Penguins (all Debian wheezy) went update without choking.

Installed packages are not identical, tho....

Have a nice Penguin!
 
Old 07-03-2012, 10:01 PM   #10
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Original Poster
Rep: Reputation: 108Reputation: 108
Hya

Self reply.

The preblematic two penguins (see post #1) went update. This time, policycoreutils choked.
Code:
# dpkg --configure policycoreutils
Setting up policycoreutils (2.1.10-9) ...
+ [ ! -e /etc/selinux/config ]
+ [ -x /etc/init.d/mcstrans ]
+ update-rc.d mcstrans defaults
+ invoke-rc.d mcstrans start
Starting mcstransd: 
invoke-rc.d: initscript mcstrans, action "start" failed.
+ exit 1
dpkg: error processing policycoreutils (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 policycoreutils
#
then it looks like that mcstrans start chokes. /etc/init.d/mcstrans reads:
Code:
start(){
        test -x /sbin/mcstransd  || exit 5
        echo -n $"Starting $prog: "
        if ! [ -d /var/run/setrans ]; then
                rm -rf /var/run/setrans
                install -d -o root -g root /var/run/setrans
                [ -x /sbin/restorecon ] && /sbin/restorecon /var/run/setrans
        fi

        unset HOME MAIL USER USERNAME
        start-stop-daemon --start --quiet --exec /sbin/mcstransd -- "$EXTRAOPTIONS"
        RETVAL=$?
        echo
        if test $RETVAL = 0 ; then
                touch $lockfile
        fi
        return $RETVAL
}
Now, it looks like that /sbin/mcstransd returns 1. man page of mcstransd does not say much about return value. I am not sure where to go next.

My next guess is whether or not kernel is related. For some reason, one of kernel parameters, "CONFIG_SECURITY_SELINUX_DISABLE" is "Y".

For several reasons, I cannot recompile kernel now. I will update in near future.

Currently, these penguins live without policycoreutils package.

cheers
 
Old 07-03-2012, 10:41 PM   #11
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

oh, the joy of selinux.

If you are not using it you should probably uninstall all the selinux realated pacakges. It seems to be the cause of all your problems.

Evo2.
 
Old 07-04-2012, 06:26 PM   #12
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Original Poster
Rep: Reputation: 108Reputation: 108
Hya,

self reply.

I checked another penguin, which does not choke, and found that "CONFIG_SECURITY_SELINUX_DISABLE" was "Y". I reinstalled policicoreutils, and see what happens. No problem!

Troubleshoot is not complete, however, practically it is solved.

Following what I did to get out of trouble.
1. tzdata package failed to configure.
2. tweak tzdata.postinst file, suggested by post #7. So other files upgraded.
3. policycoreutil package failed to configure.
4. purge policycoreutil package.
5. reinstall policycoreutil package.

Thanks for your help.

Have a Happy Penguin!
 
  


Reply

Tags
aptitude, configure, tzdata, update



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Newly installed debian sid & saved debian wheezy home would like to transfer files EDDY1 Linux - Newbie 11 01-20-2012 07:43 PM
[SOLVED] Debian wheezy amd64: runPMV (mgltools) dies. kaz2100 Debian 1 12-16-2011 01:02 AM
Wheezy netinstall can't configure DHCP penyuan Debian 5 12-05-2011 01:32 PM
LXer: Debian to offer MultiArch support with Debian Wheezy 7 in 2013 LXer Syndicated Linux News 0 08-11-2011 01:50 AM
LXer: Debian looking at a June 2012 freeze for Debian Wheezy LXer Syndicated Linux News 0 08-10-2011 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration