Date: Tue, 5 Jul 2005 13:12:05 +0100 From: Brian Candler <B.Candler@pobox.com> To: Marcin Jessa <lists@yazzy.org> Cc: freebsd-current@freebsd.org, Giorgos Keramidas <keramida@freebsd.org> Subject: Re: getty replacement Message-ID: <20050705121205.GA25554@uk.tiscali.com> In-Reply-To: <20050705124501.6c9de799.lists@yazzy.org> References: <20050705115234.44adc0ed.lists@yazzy.org> <20050705102010.GA5663@beatrix.daedalusnetworks.priv> <20050705124501.6c9de799.lists@yazzy.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 05, 2005 at 12:45:01PM +0200, Marcin Jessa wrote: > > On 2005-07-05 11:52, Marcin Jessa <lists@yazzy.org> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050705121205.GA25554>