>
>  > 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

Is this the right behaviour?

Reply via email to