From owner-freebsd-current@FreeBSD.ORG Tue Jul 5 12:12:06 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 070EB16A41C; Tue, 5 Jul 2005 12:12:06 +0000 (GMT) (envelope-from personal@bloodhound.noc.clara.net) Received: from leto.uk.clara.net (leto.uk.clara.net [80.168.69.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC4D143D48; Tue, 5 Jul 2005 12:12:05 +0000 (GMT) (envelope-from personal@bloodhound.noc.clara.net) Received: from bloodhound.noc.clara.net ([195.8.70.207]) by leto.uk.clara.net with esmtp (Exim 4.43) id 1DpmHU-000Os3-ME; Tue, 05 Jul 2005 13:12:04 +0100 Received: from personal by bloodhound.noc.clara.net with local (Exim 4.50 (FreeBSD)) id 1DpmHV-0006fE-MI; Tue, 05 Jul 2005 13:12:05 +0100 Date: Tue, 5 Jul 2005 13:12:05 +0100 From: Brian Candler To: Marcin Jessa Message-ID: <20050705121205.GA25554@uk.tiscali.com> References: <20050705115234.44adc0ed.lists@yazzy.org> <20050705102010.GA5663@beatrix.daedalusnetworks.priv> <20050705124501.6c9de799.lists@yazzy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050705124501.6c9de799.lists@yazzy.org> User-Agent: Mutt/1.4.2.1i Sender: Brian Candler Cc: freebsd-current@freebsd.org, Giorgos Keramidas Subject: Re: getty replacement X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2005 12:12:06 -0000 On Tue, Jul 05, 2005 at 12:45:01PM +0200, Marcin Jessa wrote: > > On 2005-07-05 11:52, Marcin Jessa wrote: > > > Hi guys. > > > > > > Is there any way to replace "/usr/libexec/getty Pc" with a custom > > > application and what would be requirements for such an app? > > > Running > > > ttyv0 "/some/app/shell_code.sh Pc" cons23 on secure > > > gives me: > > > init: getty repeating too quickly on port /dev/ttyv0, sleeping 30 secs > > > and my code is not executed. > > > > Your shell script exits immediately, which leads init to believe > > something caused it to exit prematurely. Shell scripts that don't > > exit, but continue working until they are explicitly terminated with > > a signal should work fine. > > That unfortunatelly does not seem to work. > I tried a shell script with a read -p "Blah blah" my_choice > which should wait for an execution but this did not work either giving me exactly the same message... Well, here's a working example, which you can use as a starting point. bloodhound:~# ls -l /var/tmp/myscript.sh -rwxr-xr-x 1 root wheel 19 Jul 5 13:09 /var/tmp/myscript.sh bloodhound:~# cat /var/tmp/myscript.sh #!/bin/sh sleep 60 bloodhound:~# grep test /etc/ttys test /var/tmp/myscript.sh cons25 on secure bloodhound:~# kill -1 1 bloodhound:~# ps auxww | grep mysc root 25581 0.0 0.4 1640 984 ?? I 1:10PM 0:00.00 /bin/sh /var/tmp/myscript.sh test bloodhound:~# Tested under FreeBSD 5.4. After 60 seconds, when the shell script exits, a new one is spawned by init: bloodhound:~# ps auxww | grep mysc root 25609 0.0 0.4 1640 1024 ?? S 1:11PM 0:00.00 /bin/sh /var/tmp/myscript.sh test HTH, Brian.