Bug 80197 - redhat-config-date crashes evert time it runs
redhat-config-date crashes evert time it runs
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-date (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Brent Fox
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-21 23:34 EST by Art Wagner
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-05-25 10:29:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
strace of command "redhat-config-date" failure (37.00 KB, text/plain)
2002-12-22 23:51 EST, Art Wagner
no flags Details
My /etc/init.d/ntpd (2.36 KB, text/plain)
2002-12-23 00:23 EST, Art Wagner
no flags Details

  None (edit)
Description Art Wagner 2002-12-21 23:34:34 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212

Description of problem:
component crashes every time it runs with the following error message;
 
/etc/init.d/ntpd: line 25: [: too many arguments
Traceback (most recent call last):
  File "/usr/share/redhat-config-date/redhat-config-date.py", line 35, in ?
    mainWindow.mainWindow().stand_alone()
  File "/usr/share/redhat-config-date/mainWindow.py", line 176, in __init__
    self.datePage = date_gui.datePage(self.dateBackend)
  File "/usr/share/redhat-config-date/date_gui.py", line 149, in __init__
    ntpStatus = mainWindow.dateBackend.isNtpRunning()
  File "/usr/share/redhat-config-date/dateBackend.py", line 163, in isNtpRunning
    line = output[0]
IndexError: list index out of range

I have strac and ltrace output if they might help?

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.bring up system
2.run "redhat-config-date" from either GUI or cli
3.
    

Actual Results:  see abobe discription

Expected Results:  bring up GUI screen

Additional info:

email me for strace and/or ltrace output
Comment 1 Brent Fox 2002-12-22 11:37:55 EST
Can you run '/sbin/service/ntpd status' and post the results to this report? 
That would be most helpful.
Comment 2 Art Wagner 2002-12-22 15:16:46 EST
Brent;
My result for; # /sbin/service/ntpd status 

bash: /sbin/service/ntpd: Not a directory

{ the command available in /sbin is "service"]
----------------------------------------------------------------

My result for; # /sbin/service ntpd status

/etc/init.d/ntpd: line 25: [: too many arguments

{ this time we executed "/etc/init.d/ntpd" (sysvinit) and it didn't like "status" 
-----------------------------------------------------
my results for; # /sbin/service ntpd --status

/etc/init.d/ntpd: line 25: [: too many arguments

{ this time we executed "/etc/init.d/ntpd" (sysvinit) and it didn't like "--status" 
=======================
Art
Comment 3 Brent Fox 2002-12-22 16:54:14 EST
Oh, I'm sorry.  I made a typo.  The command should be:

'/sbin/service ntpd status'  

Comment 4 Art Wagner 2002-12-22 17:14:05 EST
On my system the /etc/init.d/ntpd bash script doesn't seem to like the "status"
parameter. The result I get for '/sbin/service ntpd status' actually executes
/etc/init.d/ntpd with the parameter "status which results in;
/etc/init.d/ntpd: line 25: [: too many arguments
Lines 19 - 28 of /etc/init.d/ntpd are;
19 # Check that networking is up.
20 [ ${NETWORKING} = "no" ] && exit 0
21
22  ntpconf=/etc/ntp.conf
23  ntpstep=/etc/ntp/step-tickers
24
25 [ -x /usr/sbin/ntpd -a -f -d $ntpconf ] || exit 0
26
27 RETVAL=0
28 prog="ntpd"

Art
Comment 5 Brent Fox 2002-12-22 21:32:01 EST
Umm, something must be very, very wrong with ntp.  Passing the 'status'
parameter to the initscript should return something like "ntpd is running" or
"ntpd is stopped".  redhat-config-date relies on some kind of response to
'/sbin/service ntpd status' in order to know if the service is running or not.

What version of ntp is installed?  

Also, what is the output of 'rpm -V ntp'?
Comment 6 Art Wagner 2002-12-22 22:10:31 EST
Output of "rpm -V ntp is;
S.5....T c /etc/ntp.conf
.....UG. c /etc/ntp/drift
S.5....T c /etc/rc.d/init.d/ntpd
------------------------------------------------------
Version of ntp per Redhat 8,0 /root/install log is;
ntp-4.1.1a-9
------------------------------------------------------
(note; see your smail at bfox@redhat.com for a question)
Comment 7 Art Wagner 2002-12-22 23:51:29 EST
Created attachment 88861 [details]
strace of command "redhat-config-date" failure

Maybe this will help. This is how the command fails on my system
Comment 8 Art Wagner 2002-12-23 00:01:17 EST
See "attachment"
Something seems to be wrong with my /etc/init.d/ntpd. It fails whenever it is
invoked from anywhere, with ANY parameter, ie: stop, start, restart, conrestart,
or status. It also fails when invoked in my sysvint startup scripts, per
/var/log/messages. As far as I knoe I HAVE NOT edited it manually but it might
have been modified ???? by the redhat sysvinit editor while I was playing with
getting ntp setup?? Would a copy of my current /etc/init.d/ntpd help you?
Art
Comment 9 Brent Fox 2002-12-23 00:19:55 EST
According to rpm -V, something has changed /etc/rc.d/init.d/ntpd.  Whatever
changed it has caused it to break.  Although it's hard to know at this point
what changed it, you may want to investigate this matter further.  I don't
believe that the Red Hat runlevel editor modifies the initscripts directly. 
Rather, I believe that it changes the symlinks in /etc/rc5.d/ for example.  

Please attach your /etc/rc.d/init.d/ntpd file to this report.  We can diff it
against the stock initscript and see where it broke.

I would now recommend that you uninstall ntp with 'rpm -e ntp --nodeps' and then
reinstall ntp from the cd.  I bet the problem will go away.
Comment 10 Art Wagner 2002-12-23 00:23:49 EST
Created attachment 88862 [details]
My /etc/init.d/ntpd
Comment 11 Brent Fox 2002-12-23 00:50:03 EST
We'll, here's the diff of the pristine initscript and the one you attached:

[bfox@snowbird ntp-4.1.1a]$ diff /etc/rc.d/init.d/ntpd /tmp/ntpd
25c25
< [ -x /usr/sbin/ntpd -a -f $ntpconf ] || exit 0
---
> [ -x /usr/sbin/ntpd -a -f -d $ntpconf ] || exit 0

So as you can see, something added a "-d" option to line 25.  I have no idea
what may have changed that file, but I don't think that any of our config tools
could do that.  Does removing the "-d" from that line fix the problem?
Comment 12 Art Wagner 2002-12-23 02:19:04 EST
I uninstalled and reinstalled ntp which fixed the problem, My /etc/init.d/ntpd
is now missing the -d. BUT!! if I add the -d back in and do "./ntpd status" 
from /etc/init.d, I get the failure as I did before, and "Data & Time" from the
GUI also fails as before. However if I then remove the -d ntpd status works OK
*BUT* "Date & Time" continues to fail ???!!!???!!!. I guess this qualifies as a
"AW SH*T". I don't know if there is anywhere we can go from here. I can't think
of anything we can do to resolve how the problem got started, or how to prevent
it occuring again??
Comment 13 Brent Fox 2002-12-23 02:34:27 EST
Yeah, I'd expect the problem to reappear if the '-d' option gets added back to
the initscript.  I will add some code to redhat-config-date that will try to
catch this problem.  Bascially, if the initscript is busted for some reason
(i.e. the program doesn't get the results it expects from the initscript) maybe
it will just  disable the ntp part of the gui.
Comment 14 Brent Fox 2002-12-23 03:05:10 EST
Should be fixed in redhat-config-date-1.5.6-1, which should appear in Rawhide
tomorrow.  

redhat-config-date now pops up a dialog saying "The NTP initscript
(/etc/rc.d/init.d/ntpd) does not seem to be functioning properly.  Try running
'rpm -V ntp' to see if the initscript has been modified.  redhat-config-date
will exit now."

This is maybe not the most elegant solution, but it works.  I decided that if
the initscript is busted, it's better to notify the user of this fact than
continue as if nothing is wrong.  Thanks for your report on this issue.

QA, please verify that this is the current behavior.
Comment 15 Peter van Egdom 2003-03-14 10:09:17 EST
I deliberately sabotaged the ntpd initscript on my system:

[root@powermate init.d]# diff ntpd.original ntpd
13c13
< . /etc/init.d/functions
---
>  /etc/init.d/functions


Running "redhat-config-date", and selecting a time server, generates these errors:

/etc/init.d/ntpd: line 143: status: command not found
/etc/init.d/ntpd: line 143: status: command not found
/etc/init.d/ntpd: line 85: failure: command not found
/etc/init.d/ntpd: line 97: daemon: command not found

I have not seen the dialog mentioned by Brent in comment #14.

Using "redhat-config-date-1.5.9-7" on Phoebe 8.0.94.
Comment 16 Brent Fox 2003-05-25 10:29:21 EDT
There is a stack of 64 bugs that have been in Modified state for a long period
of time.  I am closing these as Rawhide now.  If you find that the issue is not
fixed, please reopen this report.

Note You need to log in before you can comment on or make changes to this bug.