Unix Technical Forum

rc.inet1.conf mod is 644

This is a discussion on rc.inet1.conf mod is 644 within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Just curious, my Slack 9.1 sits behind a router and has a rfc 1918 ip address/net. The /etc/rc.d/rc.inet1.conf is ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 09:23 PM
David
 
Posts: n/a
Default rc.inet1.conf mod is 644

Just curious, my Slack 9.1 sits behind a router and has a rfc 1918 ip
address/net. The /etc/rc.d/rc.inet1.conf is set to 644, yet I have
normal intra/internet access. I'm assuming because it's read as a
config file that it only needs to be 755 if I should want to source it
directly? Is this right? If not, where is my ip address and gateway
kept?

No big deal, just trying to keep track of things.

Best regards, and tia...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 09:23 PM
Joost Kremers
 
Posts: n/a
Default Re: rc.inet1.conf mod is 644

David wrote:
> Just curious, my Slack 9.1 sits behind a router and has a rfc 1918 ip
> address/net. The /etc/rc.d/rc.inet1.conf is set to 644, yet I have
> normal intra/internet access. I'm assuming because it's read as a
> config file that it only needs to be 755 if I should want to source it
> directly?


what do you mean by "sourcing it directly"? if you mean *running* it
from the command line, yes, it should be +x. (not necessarily 755, 700
would do just as well, since you'll need to run it as root anyway.)

but if you actually mean "sourcing" it (see 'man bash', search for
'source'), then no, it does not need to be executable. sourcing a file can
be done when the file is -x.

btw, rc.inet1.conf is not really read as a config file, it *is* sourced:
just check /etc/rc.d/rc.inet1. the dot is a short-hand for the source
command.

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 09:24 PM
Jeffrey Froman
 
Posts: n/a
Default Re: rc.inet1.conf mod is 644

David wrote:

> The*/etc/rc.d/rc.inet1.conf*is*set*to*644,*yet*I*have
> normal intra/internet access.**I'm*assuming*because*it's*read*as*a
> config file that it only needs to be 755 if I should want to source it
> directly?**Is*this*right?


Essentially, this is correct. As Joost pointed out, the script doesn't
actually require these permissions to be sourced, but the scripts that
source these files check for executable permissions before sourcing, when
it is appropriate. This allows you to control which services start at boot
time by toggling the executable flag.

The configuration files are sourced regardless of permissions.


Jeffrey
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 09:25 PM
David
 
Posts: n/a
Default Re: rc.inet1.conf mod is 644

Joost and Jeffrey,
Thanks for the explanation.

On 2005-01-27, Joost Kremers <joostkremers@yahoo.com> wrote:
> but if you actually mean "sourcing" it (see 'man bash', search for
> 'source'), then no, it does not need to be executable. sourcing a file can
> be done when the file is -x.


Yes, I had a bit of confusion with the term 'sourcing', but as you
suggested, I took a peek in man bash and I think I've got things
straight between executing and sourcing a file.

I notice that in my rc.d directory, besides 'rc.inet1.conf',
'rc.netdevice' and 'rc.serial' also don't begin with the '#!/bin/sh', so
I assume they could be chmod to 644 without effecting my system?

And then when the config files are sourced, as in the case of
'rc.inet1.conf' because it hasn't any commands, it's setting environment
variables?

Thanks for the info,
And Best regards....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 09:25 PM
Joost Kremers
 
Posts: n/a
Default Re: rc.inet1.conf mod is 644

David wrote:
> I notice that in my rc.d directory, besides 'rc.inet1.conf',
> 'rc.netdevice' and 'rc.serial' also don't begin with the '#!/bin/sh', so
> I assume they could be chmod to 644 without effecting my system?


not necessarily: check the rc files from which they are read (just do a
'grep rc.netdevice' in /etc/rc.d/). the rc scripts that actually get
executed (rc.S, rc.M; check /etc/inittab) are the ones that source the
other scripts. for most of these, they check whether they are executable
and only if they are do they actually source them. that setup makes it easy
to enable or disable certain rc scripts: just chmod +/-x them and you're
done.

compare this to the way the .conf files are sourced: they are sourced
without the sourcing script checking if they're executable.

> And then when the config files are sourced, as in the case of
> 'rc.inet1.conf' because it hasn't any commands, it's setting environment
> variables?


well, they set up variables which are then used in the script that reads
the .conf file. i wouldn't call them environtment variables, because they
are lost as soon as the sourcing script exits. they are not retained in the
environment of any user.

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:55 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com