Re: WARNING: invoke-rc.d called during shutdown sequence
On Sun, Jun 28, 2009 at 10:28 PM, Robert
S<robert.spam.me.senseless@gmail.com> wrote:
>> > I get the above error message whenever I use invoke-rc.d. This isn't a
>> > major problem except that I get annoying messages every night when logrotate
>> > restarts services. Is there a fix for this?
>> >
>> > # invoke-rc.d samba restart
>> > invoke-rc.d: ----------------------------------------------------
>> > invoke-rc.d: WARNING: invoke-rc.d called during shutdown sequence
>> > invoke-rc.d: enabling safe mode: initscript policy layer disabled
>> > invoke-rc.d: ----------------------------------------------------
>>
>>
>> So I suppose the first question is, what's the output of
>> /sbin/runlevel on your system?
>
> I've fixed this problem by rebooting my system. Before I did this I ran
> /sbin/runlevel and the output was
>
> 2 6
>
> It looks to me as if the command
>
> RL=`${RUNLEVEL} | sed 's/.*\ //'`
> returns the PREVIOUS runlevel - not the current one. For example:
>
> runlevel | sed 's/.*\ //'
>
> returns 2, whereas /sbin/runlevel returns
>
> N 2
The runlevel command returns the previous runlevel (the N) and the
current (2). Previous to rebooting your system, the command believed
your previous runlevel to be 2 and your current to be 6. The script
will give the warning it gave if the current runlevel is either 0
(halt) or 6 (reboot).
You can see what the command was returning simply by running this:
cbell@circe:~$ echo 2 6 | sed 's/.*\ //'
6
cbell@circe:~$
Note that '6' is what's being returned and thus the warning.
The question is how did your system get into a state of being in
runlevel 6 without actually rebooting. Did anything odd happen before
you started seeing this issue? Did you perhaps start a reboot with
the shutdown command and the abort it before it completed?
--
Chris
Reply to: