Comment 5 for bug 259965

Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote : Re: [Bug 259965] Re: shutdown: unconditionally removes /etc/nologin

On Thu, Jun 18, 2009 at 05:53:27PM -0000, Scott James Remnant wrote:
> I assume that you are changing some configuration, creating an
> /etc/nologin and then rebooting.
>
> What steps do you take to do this?

It is part of a maintanence cycle with tape backups. We wish to reboot a
machine and keep it unavailable to regular users until the tape backups
complete at which point /etc/nologin is removed.

At present we have to modify the distrubution to get around this behavior,
but we'd prefer if upstart could handle it. In an init.d script:

        # restore /etc/nologin since init wipes it
        if [ -e /etc/nologin_reboot ]; then
                /bin/mv /etc/nologin_reboot /etc/nologin
        fi

        # preserve /etc/nologin if some condition is met, else remove it
        if [ -e /etc/nologin ]; then
                if ! $OUR_CONDITION ; then
                        /bin/rm /etc/nologin
                fi
        fi

Ryan