Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 6485 - /mnt/.init.d/failed being {killed at the wrong time,not created at the right time} ?
Summary: /mnt/.init.d/failed being {killed at the wrong time,not created at the right ...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 All
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-14 18:19 UTC by SpanKY
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2002-08-14 18:19:04 UTC
well, as the Summary states, i do not have a /mnt/.init.d/failed directory ...
i checked all my boxes running gentoo, and none of them have it ...

the directory does get made in /sbin/rc ... but then at the end it gets killed:
#runlevel end, so clear stale fail list
rm -rf ${svcdir}/failed &>/dev/null

the thing is though, when a service fails, it doesnt create that dir again ...
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-08-14 19:54:59 UTC
It is only for runlevel change.  Check the code again ... The whole point is
that its life span is only that of the time /sbin/rc runs to check that it
do not try to start the same service twice during runlevel change.

And /sbin/runscripts.sh will only use it if it exists .. which complements
above statement.

Why is this an issue for you ?
Comment 2 SpanKY gentoo-dev 2002-08-14 20:44:57 UTC
by issue i mean, when a service fails, it cannot put a link 
into /mnt/.init.d/failed/ to indicate so

in my case, samba failed, and couldnt put a link in there
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2002-08-15 01:20:40 UTC
> the directory does get made in /sbin/rc ... but then at the end it gets killed:
> #runlevel end, so clear stale fail list
> rm -rf ${svcdir}/failed &>/dev/null

Again, that is the intention.

> by issue i mean, when a service fails, it cannot put a link 
> into /mnt/.init.d/failed/ to indicate so

Once again, /mnt/.init.d/failed/ is only present *during* a runlevel
change.  It is used so that the init stuff do not try to start a
service more than once.  It should not exist after the runlevel change,
as you may for example remove the stale pidfile, and then start it
manually agian ... if /mnt/.init.d/failed/ was present, it will not
start again even if it could.

> in my case, samba failed, and couldnt put a link in there

---------------------------------------------------------------------
        # do not try to stop if it had already failed to do so on runlevel change
        if [ -L ${svcdir}/failed/${myservice} ] && \
           [ -d ${svcdir}/softscripts.new ]
        then
                exit 1
        fi
----------------------------------------------------------------------

----------------------------------------------------------------------
                #did we fail to stop? create symlink to stop multible attempts at
                #runlevel change
                if [ -d ${svcdir}/failed ]
                then
                        ln -sf /etc/init.d/${myservice}
${svcdir}/failed/${myservice}
                fi
-----------------------------------------------------------------------

Above two snippits are out of /sbin/runscript.sh.  It will only create the
symlink if ${svcdir}/failed exists.  And it will *not* start if
${svcdir}/failed/${myservice} exits.  And like the comments state, this
is all DURING a runlevel change.

You do not want it there if starting a script manually, as then it will
NEVER start without removing the symlink again.  The whole idea is that
the existance of ${svcdir}/failed say that we are BUSY with a runlevel
change.

PLEASE, read /sbin/rc and /sbin/runscript.sh a FEW times.  Then, if you
still have a issue, explain in at least 5 or so paragraphs WHY you want
it created with examples, etc.  Also WHEN, etc. Basically, i want a full
description of why, when, and how you think it should then work.
Comment 4 SpanKY gentoo-dev 2002-08-15 07:10:20 UTC
sorry, but i thought the reason for failed was for failed services (failing at 
any time) rather than ones just started at runlevels

i read the comments but they apparently went over my head ;)
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2002-08-15 13:07:46 UTC
Ok, great :)  I know I am not the best comment writer or 'chooser of names' for
variables, etc, so you are excused :P