Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 130476 - rc_update bug in rc42/41
Summary: rc_update bug in rc42/41
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-04-19 06:38 UTC by Alvin Lee
Modified: 2006-04-25 08:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alvin Lee 2006-04-19 06:38:50 UTC
These codes will be found in /usr/lib/catalyst2/targets/support/rc-update.sh
It's intend is to remove runlevel in which have no regular file,but there may be some link files in it. So we cannot use command rmdir but rm -rf 


CONTENTS=$(find /etc/runlevels/${x} -type f)
if [ -z "${CONTENTS}" ]
then
      echo "${x}: Empty runlevel found.... deleting"
      rmdir "/etc/runlevels/${x}"
fi
Comment 1 Alvin Lee 2006-04-19 06:40:13 UTC
I have forgot to give the exact line number of these words.
They are lying in the last 10 lines of rc-update.sh
Comment 2 Chris Gianelloni (RETIRED) gentoo-dev 2006-04-19 06:53:31 UTC
I really do appreciate your finding these bugs.  Is there a chance I could get you to start provising patches instead?  It makes things much easier.

cp filename filename.orig
edit filename (fix bug)
diff -uN filename.orig filename > filename.patch

This way there's no confusion on what you think should/needs to be changed.

Also, if there are symlinks in the runlevel, we shouldn't be removing it, so I think instead the CONTENTS variable needs adjustment to look for both files *and* symlinks.  Wouldn't you agree?
Comment 3 Andrew Gaffney (RETIRED) gentoo-dev 2006-04-19 06:59:35 UTC
A better solution is probably to check for symlinks instead of files with 'find /etc/runlevels/${x} -type l'.

If the runlevel is one of the default ones provided by baselayout, it will probably have a .keep file in it. While it's unlikely that the boot or default runlevels will ever be empty, it's still probably a good idea to make sure that /etc/runlevels/${x}/.keep doesn't exist before removing the directory and bail out (non-fatally, of course) if it does exist.
Comment 4 Alvin Lee 2006-04-19 07:26:14 UTC
yeah,I think you are right. I was just wondering if deleting runlevel in which have no regular files, maybe there will no runlevel left because most of files in runlevel are links. And I promise that I will use patch next time to make things easier.^^
Comment 5 Chris Gianelloni (RETIRED) gentoo-dev 2006-04-19 07:45:01 UTC
No problem, Alvin.  =]

Anyway, I think instead I'm going to remove all of the code for runlevel removal, since there's not really much point in it and the runlevels need to be present for the installer anyway, even if they are empty.
Comment 6 Chris Gianelloni (RETIRED) gentoo-dev 2006-04-25 08:14:45 UTC
Fixed in 2.0_rc43 and above.