Subject: pkg/19086: bpalogin exits without connecting when run from rc script
To: None <gnats-bugs@gnats.netbsd.org>
From: None <sam@uong.bpa.nu>
List: netbsd-bugs
Date: 11/17/2002 03:54:34
>Number:         19086
>Category:       pkg
>Synopsis:       bpalogin exits without connecting when run from rc script
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 17 03:55:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sam Uong
>Release:        NetBSD 1.6
>Organization:
>Environment:
NetBSD uong.bpa.nu 1.6 NetBSD 1.6 (AFGAM) #0: Thu Oct 24 18:34:55 EST 2002     root@uong.bpa.nu:/usr/src/sys/arch/i386/compile/AFGAM i386

>Description:
When the package net/bpalogin is installed, the startup script copied from /etc/pkg/etc/rc.d/bpalogin to /etc/rc.d/bpalogin and the system restarted, the script will fail to start up bpalogin properly and connect the system to bigpond.  However, it does work when the script is run manually after the system has booted.
>How-To-Repeat:
cd /usr/pkgsrc/net/bpalogin
make install
cp /usr/pkg/etc/rc.d/bpalogin /etc/rc.d
reboot
>Fix:
the following patch fixes the problem:

--- unixmain.c.orig     Fri May 10 18:23:13 2002
+++ unixmain.c  Fri May 10 18:23:26 2002
@@ -190,8 +190,8 @@
                }
        }
 
-       if(makedaemon && fork())
-               exit(0);
+       if(makedaemon)
+               daemon(0,0);
 
        openlog("bpalogin",LOG_PID,LOG_DAEMON);
 

Thanks to Jason Allen (http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=006e01c0f00b%2424dd18f0%240801a8c0%40devil)
>Release-Note:
>Audit-Trail:
>Unformatted: