Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Distribution: PCLinuxOS 0.93 and 0.92, Vector sometimes
Posts: 825
Rep:
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.
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?
Distribution: PCLinuxOS 0.93 and 0.92, Vector sometimes
Posts: 825
Rep:
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
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.