>
> >> > 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:
>
> cb...@circe:~$ echo 2 6 | sed 's/.*\ //'
> 6
> cb...@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?
>
Aha. I thought the second figure from /sbin/runlevel was the previous
runlevel (mainly because it was 6!). I don't know how I ended up in
runlevel 6 but a reboot (x2) has fixed it. Thanks.