[Mageia-dev] Cleaning up init

Colin Guthrie mageia at colin.guthr.ie
Tue Jan 29 11:19:46 CET 2013


'Twas brillig, and JA Magallón at 29/01/13 00:03 did gyre and gimble:
> After a test with symlinks -r, I discovered I had /etc/rc.d full of
> dangling symlinks, due to services moved to systemd.
> 
> Should an update of initscripts clean them (symlinks -rd /etd/rc.d) ?
> I suppose this will also happen when people updates mga2 to mga3...

I've added a filetrigger to initscripts package to clean up the dangling
symlinks.

I didn't use the symlinks tool as it's not a required package.

find /etc/rc.d/rc{0,1,2,3,4,5,6,7}.d -type l -exec sh -c 'if [ ! -e {}
]; then rm -f {}; fi' \;

This does much the same job, but "find" is already used in multiple
places so probably a better solution even if the command is more convoluted!

If anyone spots any issues with this, please shout.

It'll be in the next initscripts package and it cleaned up all the
dangling symlinks in /etc/rc.d for me.

Col

-- 

Colin Guthrie
colin(at)mageia.org
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the Mageia-dev mailing list