From: Stef Walter <stefw@redhat.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] agetty: Reprompt and reprint /etc/issue if we receive SIGUSR1
Date: Tue, 15 Jul 2014 09:57:12 +0200 [thread overview]
Message-ID: <53C4DED8.2070706@redhat.com> (raw)
In-Reply-To: <20140715074717.GN30288@x2.net.home>
On 15.07.2014 09:47, Karel Zak wrote:
> On Mon, Jul 07, 2014 at 09:31:24AM +0200, Stef Walter wrote:
>> /* Get user name, establish parity, speed, erase, kill & eol. */
>> static char *get_logname(struct options *op, struct termios *tp, struct chardata *cp)
>> {
>> @@ -1625,9 +1676,18 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
>>
>> while (*logname == '\0') {
>>
>> + reprompt_flag = 0;
>> +
>> /* Write issue file and prompt */
>> do_prompt(op, tp);
>>
>> + /* If asked to reprompt *before* terminal input arrives, then do so */
>> + if (!wait_for_term_input(STDIN_FILENO) && reprompt_flag != 0) {
>> + if (op->flags & F_VCONSOLE)
>> + termio_clear(STDOUT_FILENO);
>> + continue;
>> + }
>
> Now when I think about it.. would be better to have this feature
> optional? I think it's overkill to have it enabled on all machines.
Sure.
> The another story is the signal usage (and possible race with login(1) as
> discussed at https://bugzilla.redhat.com/show_bug.cgi?id=1110763).
>
> What about for example:
>
> agetty --reload-trigger <file>
As I said in the above bugzilla bug, I don't mind doing this ... but in
my opinion unix signals are meant exactly for this use case, and are
used by many (most?) other linx processes as a reload trigger.
> and use inotify for the <file>. I guess this way also allows to avoid
> the ioctl() tty voodoo and you can use select() for the inotify and
> tty file descriptors.
Unfortunately that's not how it works. When in canonical mode, the tty
file descriptor only becomes readable once a complete line has been
entered. I've verified that select() does not return until <enter> is
pressed.
Hence the switch to non-canonical mode, until the first character is
pressed, and then back to canonical.
Cheers,
Stef
next prev parent reply other threads:[~2014-07-15 7:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 7:31 [PATCH] agetty: Reprompt and reprint /etc/issue if we receive SIGUSR1 Stef Walter
2014-07-14 13:37 ` Karel Zak
2014-07-15 7:35 ` Stef Walter
2014-07-15 7:51 ` Karel Zak
2014-07-15 7:47 ` Karel Zak
2014-07-15 7:57 ` Stef Walter [this message]
2014-07-15 9:19 ` Karel Zak
2014-07-15 12:40 ` Stef Walter
2014-07-15 16:12 ` Stef Walter
2014-07-16 10:02 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C4DED8.2070706@redhat.com \
--to=stefw@redhat.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.