LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-24-2003, 07:34 PM   #1
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
understanding exacutables


I am trying to understand executable files. Some of the files in my /etc/rc.d have permission of execute and others do not. Are only the ones with permission set for execute(-rwx--x--x) used at startup. Are all of the other shell scripts(-rw-r--r--) in there dormant, in the sence that they need to change their permissions to be used?

I asked this because I added a firewall script to /etc/rc.d that Guarddog created. Which seems to be working(firewall starts at bootup). I wasn't sure if making something exacutable was just about changing the permissions.

Last edited by shanenin; 10-24-2003 at 09:30 PM.
 
Old 10-24-2003, 08:00 PM   #2
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
I think only files ending with .sh and having the executable bit set are executed in rc.d at startup - at least this is how things work in FreeBSD, and maybe in Linux, too.
Thus rc.d may contain sample scripts that are not executed at startup, since they do not end with .sh.
 
Old 10-24-2003, 08:06 PM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Sorry for misleading you, but I took a look at /etc/rc.d of my Linux machine, and I saw there virtually no files ending with .sh, so Linux works differently.
However, I am sure that only files having the executeablebit set are executed there.
 
Old 10-24-2003, 08:08 PM   #4
Edward78
Member
 
Registered: Jul 2002
Distribution: OpenSuSE 11
Posts: 441

Rep: Reputation: 30
.bin are executable also right? I think so.

Last edited by Edward78; 10-24-2003 at 08:09 PM.
 
Old 12-22-2003, 06:35 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Looking in my /etc/init.d and /etc/rc.d/rc5.d directories, all of the listed files have the executable bits set. The files that run on startup or shutdown are the links in the /etc/rc.d/rc<runlevel>.d directories. They will point to programs (scripts) in the /etc/init.d directory. The S<num> prefix will determine the order they will start.

A binary program or script needs the x bit set to run. The .bin extension is usually added to let you know that it is an executable. For example, the netscape install program ends with the .bin extension, to remind you to use chmod +x on the file after downloading it.

Unix/Linux file systems don't have the text/binary file type distinctions that MSDOS / Windows does.
 
Old 12-22-2003, 08:42 PM   #6
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Exactly - extensions are purely descriptive for the most part (though some programs are coded to look for certain ones) and the only files that will execute are those that have the executable bit. However, some configuration files will be read by an executable and have the *effect* of being commands. But, in essence, it's an on/off thing - chmod 600 a binary and it won't run. Chmod 700 a script and it will. Of course, if you chmod a grocery list to execute bash'll just spew a lot errors - but it will 'execute'.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
help understanding ln dr_zayus69 Linux - General 3 01-14-2005 08:33 PM
A better understanding! nny0000 Slackware 1 04-14-2004 12:01 PM
Understanding X?? ++ bdp Linux - General 2 02-25-2004 05:47 PM
Understanding X?? nny0000 Linux - General 2 02-25-2004 02:07 AM
Understanding df -k itsjustme Linux - General 6 10-28-2003 12:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:23 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration