Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I accidentally removed /etc/rc.d/rtadvd from my FreeBSD system (8.2-RELEASE)

What is the best way of getting such system file restored?

share|improve this question
    
What filesystem are you using? If it's ZFS, you might be lucky :) –  rozcietrzewiacz Dec 21 '11 at 9:16
    
@rozcietrzewiacz No, it's UFS. And I didn't make any changes to that file, so I just have to find the default file somewhere and put it back. –  Peter Smit Dec 21 '11 at 9:20
add comment

3 Answers

The CVSWeb got it covered, but ident /etc/rc.d/rtadvd on my 8.2-RELEASE-p3 system yields

 $FreeBSD: src/etc/rc.d/rtadvd,v 1.12.2.1.6.1 2010/12/21 17:09:25 kensmith Exp $

which I can't find there... hope this still helps, rev 1.12 is tagged RELENG_8.

share|improve this answer
add comment

This file is in the base system, so grab the base system archive and extract that particular file.

cd /tmp
wget -r ftp://ftp.fi.freebsd.org/pub/FreeBSD/releases/i386/8.2-RELEASE/base
cd /
cat /tmp/ftp.fi.freebsd.org/pub/FreeBSD/releases/i386/8.2-RELEASE/base/base.?? |
tar -xzf - etc/rc.d/rtadvd

Alternatively, since this file is identical to its source, you can grab etc/rc.d/rtadvd from the source tree, either on your system if you've unpacked it (/usr/src/etc/rc.d/rtadvd) or on the web. I'd expect the file to be in /etc/rc.d in the CVS source tree view with the RELENG_8_2_0_RELEASE tag; I don't know why it doesn't appear there. You can get it from the svn source tree view in the release/8.2.0 branch.

share|improve this answer
add comment
up vote 0 down vote accepted

A small further investigation learned that the base versions are stored in the kernel source in /usr/src/etc.

So a cp /usr/src/etc/rc.d/rtadvd /etc/rc.d/rtadvd solved my problems.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.