slogin

 [image of the Head of a GNU]


Overview

Slogin is a login program to be used in single-user mode. It prompts the user:

root password (or ^D to log in as a user):

and waits for input.

If the user supplies the root password, slogin immediately initiates a root login session. Otherwise, if the user presses Control-D, the program prompts for user name and password and initiates a non-superuser session, provided that the supplied credentials are correct.

In both cases slogin does not try to write any files, in particular, it does not modify /var/log/utmp and /var/log/wtmp. This makes it useful in start-up scripts when the root maintenance is necessary, escpecially when the partition containing these files is not mounted (e.g. fsck failed).

Example

The usual startup sequence is:

/sbin/fsck -A
RC=$?
if [ $RC -ge 4 ]; then
	echo "***********************************"
	echo "*** ERROR CHECKING FILESYSTEMS. ***"
	echo "*** SYSTEM NEEDS MAINTENANCE.   ***"
	echo "***********************************"
	slogin
elif [ $RC -ge 2 ]; then
        echo "***********************************"
        echo "*** The filesystem was changed. ***"
        echo "*** The system will now reboot. ***"
        echo "***********************************"
	umount -a -r
	reboot -f
fi

Downloads

The project's homepage at Puszcza contains latest news and patches for the project.

Stable releases are available from download.gnu.org.ua. Latest stable release is slogin-0.1.tar.gz.