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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
First, it should not be mode 777. At most it could be 755. Having world write access would allow anyone to change the file... and be able to gain root access when it is run by root - at boot time or any other time.
Next, for it to be run at boot time, you might check the security labels of other scripts... If the script doesn't have the proper label it can't be executed.
this changes in CenOS 7, I believe the security label changes to help isolate boot utilties from introducing security failures (which would be caused by having world write access).
It should run fine interactively. If not, you can use the "-vx" option to turn on verbose messages.
The only executable (to start with) is /bin/sh, so that has to exist. One thing - depending on the location of the shell script: If it is a partition mounted with noexec, then you would get the error message you are getting.
I don't have a handy CentOS 6 system, but it should be linked to /bin/bash.
The other commands could be a problem if the PATH environment is not what the script expects, but that depends on WHEN it gets executed. A script like this would be running from rc.local.
NOTE: output to stdout will not be visible as the console terminals are not set up. Redirections to /dev/console should go to what is currently the console (and show in logs), but may also not be visible (depends on version - I think there is/will be a problem with CentOS 7, but I don't have it running at the moment either).
i want to make a script file to read MAC address and hdd no. and size, which should be run during boot up of the linux machine.
thats y i put the file in '/etc/rc.d/init.d/info.sh' file name is 'info.sh'
i did chmod +x /etc/rc.d/init.d/info.sh
chmod 755 /etc/rc.d/init.d/info.sh
just for testing to make sure that it's working properly or givin perfect output, i want to run it manually...
after that i will check at the time of booting.
all commands of info.sh file is working perfectly.. no doubt because each and every command i checked manually by typing in linux terminal..