Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
openrc: runscript.sh path-dependency issue
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
git.user
n00b
n00b


Joined: 24 Apr 2008
Posts: 2

PostPosted: Fri Apr 25, 2008 10:08 am    Post subject: openrc: runscript.sh path-dependency issue Reply with quote

G' day

it seems like recently unmasked openrc has subtle path dependency issue. I mean a piece of code looking for the CONFDIR: runscript.sh :49

_conf_d=${1%/*}/../conf.d
# If we're net.eth0 or openvpn.work then load net or openvpn config
_c=${RC_SVCNAME%%.*}
if [ -n "${_c}" -a "${_c}" != "${RC_SVCNAME}" ]; then
if [ -e "${_conf_d}/${_c}.${RC_RUNLEVEL}" ]; then
. "${_conf_d}/${_c}.${RC_RUNLEVEL}"
elif [ -e "${_conf_d}/${_c}" ]; then
. "${_conf_d}//${_c}"
fi
fi
unset _c

As i can see an ultimate goal of path dependency is that we now (should be) able to create init.d overlay in (at least) /usr/local/etc/init.d. Well, iiuc /sbin/rc only looking for the list of services in runlevels but starting it as execl("/etc/init.d/someservice"..., but what if we try to start it as /etc/runlevels/default/someservice by hand? oops, _conf_d=${1%/*}/../conf.d will become /etc/runlevels/conf.d/ but where's conf.d in /etc/runlevels?
yep, it can be easily fixed by symlink to /etc/conf.d but shouldn't it be documented at least?
( btw if only one overlay is allowed it probably more straightforward way to check a LOCAL_PREFIX, nop? )
Back to top
View user's profile Send private message
Dagger
Retired Dev
Retired Dev


Joined: 11 Jun 2003
Posts: 765
Location: UK

PostPosted: Fri Apr 25, 2008 11:30 am    Post subject: Reply with quote

correct me if I'm worng, but all files in /etc/runlevels/* are symlinks, and if you run them manually wont you run a real init script from init.d?


Code:

/etc/runlevels/boot $ sudo ./net.lo restart
net.lo                       | * WARNING: you are stopping a boot service
net.lo                       | * Bringing down interface lo
net.lo                       | *   Caching network module dependencies
net.lo                       | * Bringing up interface lo
net.lo                       | *   127.0.0.1/8 ...                                                         [ok]
net.lo                       | *   Adding routes
net.lo                       | *     127.0.0.0/8 via 127.0.0.1 ...                                         [ok]



As far as I know the main purpose for /usr/local/etc/init.d is to have it working not only with Gentoo, but also with *BSD systems.
_________________
95% of all computer errors occur between chair and keyboard (TM)
Join the FSF as an Associate Member!
Post under CC license.
Back to top
View user's profile Send private message
git.user
n00b
n00b


Joined: 24 Apr 2008
Posts: 2

PostPosted: Fri Apr 25, 2008 2:25 pm    Post subject: Reply with quote

Dagger wrote:
correct me if I'm worng, but all files in /etc/runlevels/* are symlinks,

it is
Dagger wrote:
and if you run them manually wont you run a real init script from init.d?


oops, it's probaby all about of my bad eanglish, because i can answer only 'nop, because this is a script with interperter #!/sbin/runscript so u run an interpreter with argument (full path to code) but not an executable and if u run it as /etc/runlevels/defaultut/script the first argument will be exactly '/etc/runlevels/defaulut/script' not /etc/init.d/script'. so hmm... i must be misunderstood your. Or do u mean runscript itself should find a link to original file? if so, i've crouling code a bit and i couldn't find this staff, probably i missing something again.
/sbin/rc do that exactly so 'normal' system bootstrap is not affected.

Dagger wrote:

Code:

/etc/runlevels/boot $ sudo ./net.lo restart
net.lo                       | * WARNING: you are stopping a boot service
... skiped...



:) i've not checking it but i'll bet net.lo will start without conf.d/net at all, nop?

as for /me, i've got this with ppp startup on my home box yesterday, i'll show it [if i'll be able :)] later (four hours or so), my working box still on baselayout-1

Dagger wrote:

As far as I know the main purpose for /usr/local/etc/init.d is to have it working not only with Gentoo, but also with *BSD systems.


probably, this is only my assumption, just because as i can see baselayout-1 have a hard paths to /etc/conf.d /etc/init.d
Back to top
View user's profile Send private message
Dagger
Retired Dev
Retired Dev


Joined: 11 Jun 2003
Posts: 765
Location: UK

PostPosted: Fri Apr 25, 2008 3:22 pm    Post subject: Reply with quote

ok I can see your point. I can't confirm it as I don't have any other interfaces than /etc/init.d/net.lo :)

Well I would suggest to post under 'portage and programming' and file a bug on bugzilla.

All the stuff which is in the official portage tree does not belong to unsupported software :)
_________________
95% of all computer errors occur between chair and keyboard (TM)
Join the FSF as an Associate Member!
Post under CC license.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum