LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-10-2003, 03:25 AM   #1
Tigger
Member
 
Registered: May 2003
Posts: 168

Rep: Reputation: 30
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!!!!
 
Old 06-10-2003, 04:33 AM   #2
carlywarly
Member
 
Registered: Feb 2003
Location: Sunny Southport, again.
Distribution: PCLinuxOS 0.93 and 0.92, Vector sometimes
Posts: 825

Rep: Reputation: 30
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.
 
Old 06-10-2003, 04:51 AM   #3
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
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
 
Old 06-10-2003, 04:52 AM   #4
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
if i do use the cdrom, do i just boot using it and then what do i need to do?

thanks
 
Old 06-10-2003, 05:21 AM   #5
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
i want to add - what should the first line of rc.sysinit.d start with?

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

thanks
 
Old 06-10-2003, 05:40 AM   #6
carlywarly
Member
 
Registered: Feb 2003
Location: Sunny Southport, again.
Distribution: PCLinuxOS 0.93 and 0.92, Vector sometimes
Posts: 825

Rep: Reputation: 30
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.
 
Old 06-10-2003, 05:40 AM   #7
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
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.
 
Old 06-10-2003, 05:42 AM   #8
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
mine is longer than that. Are you sure it is rc.sysinit.d?

thanks
 
Old 06-10-2003, 05:44 AM   #9
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
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
 
Old 06-10-2003, 05:46 AM   #10
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
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?
 
Old 06-10-2003, 05:48 AM   #11
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
also, the error comes up as well if i try to edit the file - "can't get temp file name"

What does this mean?
 
Old 06-10-2003, 06:20 AM   #12
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
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
 
Old 06-10-2003, 06:23 AM   #13
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
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?
 
Old 06-10-2003, 06:43 AM   #14
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
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
 
Old 06-10-2003, 06:44 AM   #15
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
yes, they do!!!

How do i do the manual mounting please looking_lost?

thanks again
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How the DNS-server is connected to work of a web-server and a mail-server? ukrainet Linux - Newbie 2 01-10-2005 09:18 PM
Relay Server<-> GatewayServer<->filtering server: PostFix, amavis,spamassassin, cyrus admore Linux - General 0 11-02-2004 08:46 AM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 06:21 AM
Unable to access my ssh server and ftp server from the Internet, but smtp works foxone Linux - Networking 1 05-28-2004 05:17 PM
Linux app-server to server StarOffice to Windows Clients: Need advice biosx Linux - Networking 3 08-14-2002 10:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration