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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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... |
| |||
| 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) |
| |||
| 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 |
| |||
| 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.... |
| ||||
| 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) |