Bug 116594

Summary: firstboot is running everytime when switching runlevel
Product: [Fedora] Fedora Reporter: David Jansen <jansen>
Component: firstbootAssignee: Brent Fox <bfox>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-03-04 23:35:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 114961    

Description David Jansen 2004-02-23 16:48:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114

Description of problem:
When switching to a different runlevel, the 'firstboot' service tries
to run. So the init script is unsuccessful in determining that it
should not run this service again.

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

How reproducible:
Always

Steps to Reproduce:
1. log in as root
2. type e.g. 'telinit 3' (or 5)
3. a couple of services which are already initialized are now
restarted (which is sort of a bug too). One of these is firstboot.
    

Actual Results:  message:
Firstboot has already been run once on this system.

In order to run firstboot from the command line, run the following
commands: (etc, it's the message /usr/sbin/firstboot gives when run
from outside the init script)

Expected Results:  I expected firstboot would not run again after
switching runlevel, or if it was run, it would recognize it has been
run before and just exit.

Additional info:

Comment 1 Brent Fox 2004-02-24 19:48:11 UTC
After firstboot runs, it calls '/sbin/chkconfig --del firstboot'. 
That should prevent firstboot from ever running again.

Was firstboot ever run to completion on this system?  

Comment 2 David Jansen 2004-02-24 21:43:49 UTC
As far as I remember it ran without problems. Might it be that it was
added back when firstboot was upgraded to version 1.3.5-1 ?
$ rpm -qp --scripts firstboot-1.3.5-1.noarch.rpm
postinstall scriptlet (using /bin/sh):
chkconfig --add firstboot
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
  rm -rf /usr/share/firstboot/*.pyc
  rm -rf /usr/share/firstboot/modules/*.pyc
  chkconfig --del firstboot
fi

(but I don't know much about the internals of rpms so I'm not sure in
which order those scripts will run from up2date)


Comment 3 David Jansen 2004-02-25 08:42:53 UTC
I (sort of) managed to reproduce the problem: uninstalled the
firstboot rpm and installed the original one from cd. on next reboot,
firstboot was run, and after that, it shut itself off, as expected.
Next, ran up2date to update to latest firstboot, and voila, it
reactivated itself and the "Firstboot has already been run once on
this system" message is back.
Actually, not only when using 'telinit' to switch runlevels, but also
on boot, but hard to see of course since X starts up immediately after
this.

Comment 4 Brent Fox 2004-03-04 23:35:56 UTC
Ah, I see.  The problem is that we're rerunning chkconfig on the
upgrade.  I've added a check to the specfile that will only run
chkconfig if /etc/sysconfig/firstboot does not exist.  This should fix
the problem.

The fix should appear in firstboot-1.3.6-1.  Thanks for your report.