LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   HELP PLEASE - My Server is down !!!!! (https://www.linuxquestions.org/questions/linux-newbie-8/help-please-my-server-is-down-64703/)

Tigger 06-10-2003 03:25 AM

HELP PLEASE - My Server is down !!!!!
 
Hi

i was running red hat 8 server with web and mail hosting.

I accidentally edited the rc.sysinit.d file and now it will not boot up. it stops with bash. If i type vi /etc/rc.d/rc.sysinit the file comes up but it cannot be edited because it is a read only file. It tells me to try ! when i try to edit using vi to change the permissions. Also i cannot edit rc.sysinit.d file anymore as it is not there but the file rc.sysinit looks exactly the same as rc.sysinit.d

How can i change the permissions and edit the file in the state it is in? Am i doomed????

The line i edited before all of this happened was !/bin/bash (line1) and the reason was because when i was booting up the system, it came up with an error saying that it did not recognise line 1. So i edited and got rid of the ! because i thought it was a mistake. What should line 1 have in this file?

Can i edit this file and bring it back online again or not?

If not, i am going to cry!!!! :(

carlywarly 06-10-2003 04:33 AM

Well, one solution would be to boot from your RH cdrom and use the rescue option. Alternatively, Vector live and Knoppix will both boot from the cdrom and allow you to try and fix your system that way.

Tigger 06-10-2003 04:51 AM

is there any other way?

I have tried using chmod on the file and it still says it is a read only file. I typed chmod a -rw rc.sysinit and it said that it was changing permissions and that the file is read only. So no changes occured.

The permissions on the file are -rwxr-xr-x root.

when i try to use the text editor vi it comes up and says it is a read only file and to use ! to override this. I do not know how to override or what command to type. I have tried chmod at this point but nothing seems to work. Comes up with can't get temp file name.

Point where system stops is bash -2 05b#. What does this mean?

What happended to rc.sysinit.d?

thanks

Tigger 06-10-2003 04:52 AM

if i do use the cdrom, do i just boot using it and then what do i need to do?

thanks

Tigger 06-10-2003 05:21 AM

i want to add - what should the first line of rc.sysinit.d start with?

Should it be !/bin/bash or #!/bin/bash ??

thanks

carlywarly 06-10-2003 05:40 AM

Here's my sysvinit file from my Vector linux setup

#!/bin/sh

# Run an init script:
startup() {
case "$1" in
*.sh)
sh "$@"
;;
*)
"$@"
;;
esac
}

# Set onlcr to avoid staircase effect.
stty onlcr 0>&1


if [ "$runlevel" = "" ]; then
runlevel=$RUNLEVEL
export runlevel
prevlevel=$PREVLEVEL
export prevlevel
fi

# Run kill scripts in the previous runlevel if not "none"
if [ ! "$prevlevel" = "N" ]; then
echoc "==> Stopping services of runlevel $prevlevel" white
for script in /etc/rc.d/rc$prevlevel.d/K* ; do
if [ -x $script ]; then
startup $script stop
fi
done
fi
echo

# Now do the startup scripts:
echoc "==> Starting services of runlevel $RUNLEVEL" white
for script in /etc/rc.d/rc$runlevel.d/S* ; do
if [ -x $script ]; then
startup $script start
fi
done
echo


Maybe that'll help.

Azmeen 06-10-2003 05:40 AM

The first line should be #!/bin/bash

Usually for shell scripts # renders the text following it as comments which will be ignored but for the first line it defines which shell should be used to run the script (this line is AKA the shebang).

When you bootup, you get a prompt you said, have you tried typing whoami to see who you're logging in as?

If you're root, then most probably you can still repair your file.

Tigger 06-10-2003 05:42 AM

mine is longer than that. Are you sure it is rc.sysinit.d?

thanks

Tigger 06-10-2003 05:44 AM

thanks azmeen, i will try that tomorrow but it looks like i am logged in as root. But even if i am logged in as root, i still cannot edit the permissions on the file rc.sysinit. I try to edit the file and it comes up read only file.

If i am not root, what happens then?

thanks

Tigger 06-10-2003 05:46 AM

yes, i was missing the #! and am trying to put it back in the file but no success to date.

Any ideas on how i can change the permissions on the file?

Tigger 06-10-2003 05:48 AM

also, the error comes up as well if i try to edit the file - "can't get temp file name"

What does this mean?

Tigger 06-10-2003 06:20 AM

this may sound stupid but when my server comes up and stops at bash -2 05b# is it a dumb idea to type su and then the root password and see if i can edit the file or will it tell me to go away?

thanks

Tigger 06-10-2003 06:23 AM

tried to boot with linux boot disk and no success, it still stops at that same point.

am i correct in typing linux params when the disk boots up?

Looking_Lost 06-10-2003 06:43 AM

It's a bit beyond my knowledge at the moment but was just wondering if you try to edit any other file do they come up as read only aswell?

Maybe disk needs manually mounted for read/write

Tigger 06-10-2003 06:44 AM

yes, they do!!!

How do i do the manual mounting please looking_lost?

thanks again


All times are GMT -5. The time now is 11:16 PM.