On Mon, 10 Jan 2000, David wrote:

> did a biggy this morning,
> 
> while copying a firewall script to /etc/rc.d/init.d , in my haste i
> copied it instead to /etc/rc.d/init

I don't have an /etc/rc.d/init on this system, but I do have /etc/rc.d/rc
... is this the file?  Regardless of what it is...read on =)

> i was su'd into root at the time, and hence forth it has copied over my
> init script.
> 
> is there anyway of restoring this back to normal, or replacing it with
> someone elses init script ?( no backup here )

Put your CD in, cd /mnt/cdrom/Mandrake/RPMS ... then do

rpm -ivh --force initscripts-*

you can also tell what package a file came from by running the 
"rpm -qf <file>" command, which will work even if the file no longer
exists:

/<2>Mandrake/RPMS (pts/1) dwild@elek# mv /etc/passwd /etc/notpasswd
/<2>Mandrake/RPMS (pts/1) dwild@elek# rpm -qf /etc/passwd
setup-2.0.6-14mdk
/<2>Mandrake/RPMS (pts/1) dwild@elek# mv /etc/notpasswd /etc/passwd
/<2>Mandrake/RPMS (pts/1) dwild@elek#

> oh will i have to do a re-install of the system all together?

No, shouldn't be necessary =)

> presently i'm running on Oxygen 3
> 
> if someone can get back to me soonest, would be great, not shutting
> down  till them....

Even if you have shut your machine down, you can enter the install from
the boot CD, then mount your root filesystem on /mnt (ctrl-alt-f2 gives
you a shell prompt after the X install is running) .. then run

rpm --root /mnt -ivh --force initscripts-*

from the corresponding directory (do a 'mount' with no args to figure out
where the cdrom is mounted, i don't remember off the top of my head)

> can u say WHY newbie's should not be messing in root?

This is how we all learn, I don't know of any admin who hasn't done
something braindead before...if it makes you feel better I accidentally
removed /bin instead of bin while screwing around doing something or
other....don't even ask ;)

-dws

Reply via email to