Subject: bin/4168: Request for init to handle pppd
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mason@primenet.com.au>
List: netbsd-bugs
Date: 09/27/1997 06:09:18
>Number: 4168
>Category: bin
>Synopsis: init can't handle pppd without changes
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Sep 26 23:20:00 1997
>Last-Modified:
>Originator: Geoff Wing
>Organization:
Geoff Wing [mason@primenet.com.au] Phone : +61-3-9818 2977
Technical Manager: PrimeNet Computer Consultants Facsimile: +61-3-9768 2909
Web: <URL:http://www.primenet.com.au/> Mobile : 0412 162 441
[ Boulderdash: <URL:http://ciips.ee.uwa.edu.au/~williams/bd/> ]
>Release: -current
>Environment:
System: NetBSD coral.primenet.com.au 1.2G NetBSD 1.2G (CORAL) #15: Tue Sep 9 21:10:53 EST 1997 mason@coral.primenet.com.au:/src/netbsd/src/sys/arch/i386/compile/CORAL i386
>Description:
/sbin/init can't handle spawning a pppd process because it wants to
add the tty name at the end. I've been running a modified /sbin/init
for over a year spawning pppd with several /etc/ttys entries like
tty01 "/usr/sbin/pppd /dev/tty01 115200 -detach" unknown on
pppd wants the tty as a first argument. getty wants it as a second.
An alternative would be to have, say, a ``%s'' argument for the tty
line but that would probably cause too many unnecessary problems for
other people upgrading, meaning they'd also have to upgrade their
/etc/ttys file. Putting `pppd' as an exception is the simplest way.
I don't know of any other programs people may use which would also
have problems like this.
>How-To-Repeat:
>Fix:
*** /usr/src/sbin/init/init.c Wed Jul 30 21:41:50 1997
--- /usr/obj/sbin/init/init.c Sat Sep 27 15:56:41 1997
***************
*** 978,984 ****
free(sp->se_getty_argv);
}
sp->se_getty = malloc(strlen(typ->ty_getty) + strlen(typ->ty_name) + 2);
! (void) sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name);
sp->se_getty_argv = construct_argv(sp->se_getty);
if (sp->se_getty_argv == NULL) {
warning("can't parse getty for port %s", sp->se_device);
--- 978,988 ----
free(sp->se_getty_argv);
}
sp->se_getty = malloc(strlen(typ->ty_getty) + strlen(typ->ty_name) + 2);
! if (strstr(typ->ty_getty, "pppd") == NULL)
! (void) sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name);
! else
! (void) sprintf(sp->se_getty, "%s", typ->ty_getty);
!
sp->se_getty_argv = construct_argv(sp->se_getty);
if (sp->se_getty_argv == NULL) {
warning("can't parse getty for port %s", sp->se_device);
>Audit-Trail:
>Unformatted: