Hi Brent, these may or may not be important for your purposes, but at least for my own tests of firstboot, it is handy. Do with them what you want ;-) : --- src/firstboot.orig Mon Jul 15 13:30:41 2002 +++ src/firstboot Mon Jul 15 13:30:13 2002 @@ -62,6 +62,11 @@ #Let's check to see if firstboot should be run or not #If we're in debug mode, run anyway. Even if the file exists if (not doDebug): + #Well first, is this even being run as root? + if os.getuid() > 0 or os.geteuid() > 0: + print "You must be root to run firstboot." + sys.exit(0) + #We're not in debug mode, so do some checking #First, look and see if /etc/sysconfig/firstboot exists try: --- src/firstbootWindow.py.orig Mon Jul 15 13:23:31 2002 +++ src/firstbootWindow.py Mon Jul 15 13:24:44 2002 @@ -262,7 +262,10 @@ def writeSysconfigFile(self, *args): #Write the /etc/sysconfig/firstboot file to tell firstboot not to run again if (not self.doDebug): - fd = open("/etc/sysconfig/firstboot", "w") + try: + fd = open("/etc/sysconfig/firstboot", "w") + except: + pass # we should never get here, as we make sure firstboot is run as root fd.write("RUN_FIRSTBOOT=NO\n") fd.close()
Hi. Thanks for the patches. I applied the first one, but not the second one. It's not really clear what to do if we can't write to /etc/sysconfig/firstboot. Wrapping the open in a try/except won't help if we fall through the except loop and then call fd.write("foo") because fd will be undefined. I've decided to leave that like it is, but the first one works fine. Thanks again for your help. I gave you credit in the changelog and the patch should appear in 0.9.9-5 when it gets rebuild tomorrow.