#!/usr/bin/perl
#use Mooix::Thing;
use Mooix::CallStack;
#use Mooix::Root;
run sub ($) {
	my $this=shift;

	# Check to see that we were run by init, and there is nothing else
	# on the stack.
	my $init=$Mooix::Root->system->init;
	my $stack=Mooix::CallStack::get();
	# Advance on to the next stack frame -- since this method is
	# stackless, that is its caller.
	my $stack=$stack->nextsegment;
	if (! $stack || $stack->nextsegment || 
	    $stack->basemethod ne 'startup' || $stack->index ne $init->index) {
		$this->croak("Permission denied; may only be run by init");
	}
	
	$this->reap(seconds => 0);
	$this->allowlogin(1);

	return 1;
}
