Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69992 - netplug 1.2.9 ebuild
Summary: netplug 1.2.9 ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Roy Marples (RETIRED)
URL: http://www.red-bean.com/~bos/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-03 17:03 UTC by Nick Jones
Modified: 2005-09-02 11:05 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Initial netplug 1.2.7 ebuild. (netplug-1.2.7.ebuild,7.04 KB, text/plain)
2004-11-03 17:04 UTC, Nick Jones
Details
ChangeLog (ChangeLog,3.55 KB, text/plain)
2004-11-03 17:05 UTC, Nick Jones
Details
Manifest (Manifest,236 bytes, text/plain)
2004-11-03 17:05 UTC, Nick Jones
Details
Metadata (metadata.xml,368 bytes, text/xml)
2004-11-03 17:05 UTC, Nick Jones
Details
Makefile patch to fix install commands (Makefile.patch,797 bytes, patch)
2004-11-03 17:06 UTC, Nick Jones
Details | Diff
digest for the tarball from the author's website (digest-netplug-1.2.7,65 bytes, text/plain)
2004-11-03 17:06 UTC, Nick Jones
Details
Fixes probing and runs dhcpcd when "alive" and kills dhcpcd nicely when disconnected. (netplug.patch,1023 bytes, patch)
2004-11-03 17:08 UTC, Nick Jones
Details | Diff
Nukes the original init script and replaces it with a Gentoo init script modeled off of proftpd (rc.netplugd.patch,1.98 KB, patch)
2004-11-03 17:09 UTC, Nick Jones
Details | Diff
New netplug ebuild (netplug-1.2.7.ebuild,857 bytes, text/plain)
2004-11-04 06:15 UTC, Søren Chrestensen
Details
New netplug ebuild (netplug-1.2.7.ebuild,857 bytes, text/plain)
2004-11-04 06:17 UTC, Søren Chrestensen
Details
cleaned up ebuild (netplug-1.2.7.ebuild,1.10 KB, text/plain)
2004-11-04 06:17 UTC, Nick Jones
Details
Combined ebuilds, added iproute2 dependency, and added the bitkeeper hack (netplug-1.2.7.ebuild,1.12 KB, text/plain)
2004-11-04 06:24 UTC, Nick Jones
Details
Makes a gentoo style init script out of the original preloaded one. (rc.netplugd.patch,1.94 KB, patch)
2004-12-13 14:46 UTC, Nick Jones
Details | Diff
Fixed init script bugs, config file locations and misc install issues. (netplug-1.2.7.ebuild,1.12 KB, application/octet-stream)
2005-01-22 18:19 UTC, Nick Jones
Details
fixed up Makefile to drop to the right names/locations (Makefile.patch,1.19 KB, patch)
2005-01-22 18:20 UTC, Nick Jones
Details | Diff
fixed inning/outing/probing script (netplug.patch,1023 bytes, patch)
2005-01-22 18:22 UTC, Nick Jones
Details | Diff
gentoo style init script patch (rc.netplugd.patch,1.92 KB, patch)
2005-01-22 18:23 UTC, Nick Jones
Details | Diff
all of the files combined (netplug.ebuild.tar.bz2,3.25 KB, application/octet-stream)
2005-02-08 12:34 UTC, Nick Jones
Details
All files, using /etc/init.d/net.eth? in netplug (netplug-1.2.7.ebuild.tar.bz2,3.70 KB, application/octet-stream)
2005-05-02 09:51 UTC, Pippin
Details
Full ebuild, patches, and necessary files. (netplug-1.2.9.ebuild.tar.bz2,10.00 KB, application/octet-stream)
2005-05-03 11:36 UTC, Nick Jones
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Jones 2004-11-03 17:03:34 UTC
An ebuild for this software does not exist in the portage system.  Netplug allows users to run a daemon in the background that will automatically sense a connection  and run the user requested sequence of events to attempt to connect to that particular network.  This ebuild includes patches to fix the Makefile, init scripts, and configure script to auto run and close dhcpcd on eth* adapters.

Reproducible: Always
Steps to Reproduce:
1. install ebuild in /usr/local/portage/net-misc/netplug along with associated files.
2. emerge netplug
3. /etc/init.d/netplugd start
4. it works.

Actual Results:  
Plugging the network connection into my laptop on various networks produced the
correct response (an automatic dhcp lease or renewal).

Expected Results:  
N/A

Gentoo Base Layout 2004.0
x86 architecture
kernel: gentoo-dev-sources-2.6.9-r1
RealTek RTL8139 embedded NIC card compiled into the kernel
Two different physical networks were tried and worked.
Comment 1 Nick Jones 2004-11-03 17:04:19 UTC
Created attachment 43247 [details]
Initial netplug 1.2.7 ebuild.
Comment 2 Nick Jones 2004-11-03 17:05:05 UTC
Created attachment 43248 [details]
ChangeLog
Comment 3 Nick Jones 2004-11-03 17:05:31 UTC
Created attachment 43249 [details]
Manifest
Comment 4 Nick Jones 2004-11-03 17:05:51 UTC
Created attachment 43250 [details]
Metadata
Comment 5 Nick Jones 2004-11-03 17:06:26 UTC
Created attachment 43251 [details, diff]
Makefile patch to fix install commands
Comment 6 Nick Jones 2004-11-03 17:06:58 UTC
Created attachment 43252 [details]
digest for the tarball from the author's website
Comment 7 Nick Jones 2004-11-03 17:08:19 UTC
Created attachment 43253 [details, diff]
Fixes probing and runs dhcpcd when "alive" and kills dhcpcd nicely when disconnected.
Comment 8 Nick Jones 2004-11-03 17:09:01 UTC
Created attachment 43254 [details, diff]
Nukes the original init script and replaces it with a Gentoo init script modeled off of proftpd
Comment 9 Daniel Black (RETIRED) gentoo-dev 2004-11-04 01:26:25 UTC
For next time - really only ebuild, patches and init scripts are required.

Comments about ebuild:
Please remove original ebuild comments.

Do the patching in a src_unpack() routine - after "unpack ${A}; cd ${S}" (I assume)

In src_install does "make DESTDIR=${D} install || die fail? If so its ok to use the alternateive although the DESTDIR option is prefered.

You don't seem to install the init script:
doinitd ${FILESDIR}/....  in src_install

Please submit a new ebuild and obselite the old one. Thanks for your ebuild - not much work to fix it.
Comment 10 Søren Chrestensen 2004-11-04 06:15:40 UTC
Created attachment 43280 [details]
New netplug ebuild

New ebuild with your inputs. The make stuff is needed else a ACCESS VIOLATION
is produced. Can fix an output if you want?
Comment 11 Søren Chrestensen 2004-11-04 06:17:12 UTC
Created attachment 43281 [details]
New netplug ebuild

New ebuild with your inputs. The make stuff is needed else a ACCESS VIOLATION
is produced. Can fix an output if you want?
Comment 12 Nick Jones 2004-11-04 06:17:21 UTC
Created attachment 43282 [details]
cleaned up ebuild
Comment 13 Nick Jones 2004-11-04 06:24:36 UTC
Created attachment 43283 [details]
Combined ebuilds, added iproute2 dependency, and added the bitkeeper hack

The original software has a method in the install that installs the init script
the patch redoes.  If doinitrd is what should be used then I'll repatch the
Makefile and run the ebuild init script loading.
Comment 14 Nick Jones 2004-12-13 14:46:36 UTC
Created attachment 45936 [details, diff]
Makes a gentoo style init script out of the original preloaded one.

Fixed a bug of not killing the right process during shutdown.  It now kill's
the netplugd process upon shutting down.
Comment 15 Roger 2004-12-24 10:30:31 UTC
First time installing netplugd with the given files by the author via email:

* Starting netplugd...
Error: /etc/netplug/netplugd.conf: No such file or directory
Warning: Could not probe for any interfaces

After specifying "-c" to manually specify the config file and getting more errors, I added this within the rc script:

--exec /usr/sbin/netplugd -- -i eth* -c /dev/null

On netplugd service start:

 * Re-caching dependency info (mtimes differ)...
 * Starting netplugd...
/etc/netplug.d/netplug eth0 probe -> pid 20333
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth1 probe -> pid 20334
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth2 probe -> pid 20335
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth3 probe -> pid 20336
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth4 probe -> pid 20337
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth5 probe -> pid 20338
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth6 probe -> pid 20339
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth7 probe -> pid 20340
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth8 probe -> pid 20341
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth9 probe -> pid 20342
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth10 probe -> pid 20343
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth11 probe -> pid 20344
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth12 probe -> pid 20345
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth13 probe -> pid 20346
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth14 probe -> pid 20347
Error: /etc/netplug.d/netplug: No such file or directory
/etc/netplug.d/netplug eth15 probe -> pid 20348
Error: /etc/netplug.d/netplug: No such file or directory
Warning: Could not probe for any interfaces

# ps -ax |grep netplugd
20349 ?        Ss     0:00 /usr/sbin/netplugd -i eth* -c /dev/null


In addition, I'm seeing more errors in reference to the /etc/netplug.d/ config files within syslog:

13:26:25  netplugd[20439]: /etc/netplug.d/netplug eth0 probe -> pid 20439
13:26:25  netplugd[20439]: /etc/netplug.d/netplug: No such file or directory
13:26:25  netplugd[20349]: eth0: state PROBING pid 20439 exited status 256
13:26:25  netplugd[20349]: Could not bring eth0 back up

Think it might be best for testers to delete all config files from their system and perform a semi-clean reinstall using the most current ebuild to verify this bug?
Comment 16 Roger 2004-12-27 11:43:06 UTC
I finally got everything working.  I've emailed all my changes required to make this ebuild work to the maintainer of the ebuild.

The major stumbling blocks:

1) The missing /etc/netplug.d/netplug file.  can be found within the scripts/ folder of the source tarball. (note, ensure the ebuild "chmod a+x" this as it is a script). 

For some reason, netplugd fails to call the fuction "in)".  To verify this, I commented out the in function.  So when netplugd recieves a net connection on eth0, it will call the "probe)" function only.  Odd, I thought "probe)" was for modprobing.

in)     
        #exec /etc/init.d/net.$dev start
        exit 0
    ;;
out)    
        exec /etc/init.d/net.$dev stop
        exit 0
    ;;
probe)
    exec /etc/init.d/net.$dev start
        exit 0

I just noticed the ebuild is suppose to patch this script, but it looks as if the ebuild is forgetting to install this script.  Looking at the ebuild src_install() and I see no mention of this file.  Although the patched version of this file should work, it will only work for users that use dhcp on their nic card!  Also note, the current formatting of this script breaks gentoo init.d scripts!  My brief hackings above are probably more gentoo init.d friendly?

2) /etc/init.d/netplugd

Correct exec line is:
start-stop-daemon --start --quiet --exec /usr/sbin/netplugd -- -c /etc/conf.d/netplugd.conf

3) /etc/conf.d/netplugd.conf
For naming consistancy within the /etc/conf.d folder, "netplugd.conf" should be renamed to "netplugd".

This file should probably also contain atleast one and only one interface name as many if not almost all users have an eth0 these days -- or else, why would they want netplugd installed then? ;-)

Well, these are my thoughts.  My netplugd is up & working here - hence, it works for me! ;-)
Comment 17 Nick Jones 2005-01-22 18:19:47 UTC
Created attachment 49240 [details]
Fixed init script bugs, config file locations and misc install issues.

I made sure to wipe away netplug completely before finalizing on this version
of the ebuild.	Hopefully this'll work for everyone as is.  Let me know either
by email or bug posts if something is still broken.

On the issue with probing for netplug:
I've been testing this on a RealTek mini-PCI card and have only been able to
make it work by ifconfig eth0 up as the probe since it doesn't do MII
monitoring when it's down.  Also, I've tried to have the config bring
/etc/init.d/net.eth0 up and down accordingly with no success because of the way
the init script works I believe...  If I recall correctly, the init script
seems to bring the interface down and back up to initialize it.  But, netplug
will reprobe bringing it back up again and thus spawning another thread of
bringing the interface up.  In any case, it makes some sense to me that only
dhcp really should be used with netplug anyway.. (unless one only used one
network with a static setting).
Comment 18 Nick Jones 2005-01-22 18:20:36 UTC
Created attachment 49241 [details, diff]
fixed up Makefile to drop to the right names/locations
Comment 19 Nick Jones 2005-01-22 18:22:28 UTC
Created attachment 49242 [details, diff]
fixed inning/outing/probing script
Comment 20 Nick Jones 2005-01-22 18:23:04 UTC
Created attachment 49243 [details, diff]
gentoo style init script patch
Comment 21 Roger 2005-01-23 16:50:47 UTC
This should make gentoo happy.  It would seem you have a thorough understanding of the problem with the netplug probing issue that I was having while deploying this.

Unfortunately, I bought another Linksys gadget, of which, required me to default back to static IP assignments! :-(

But remember the motto of Netplug, it is to do what Windows does automatically.  And Windows does detect a cable attached even when static ip is chosen.

When I get time, I'll grab a copy and play with it to see what I can make it do.
Comment 22 Nick Jones 2005-02-08 12:34:33 UTC
Created attachment 50775 [details]
all of the files combined

Unpack this in /usr/local/portage and you'll have everything you need to
test/use netplug until it goes live in portage.
Comment 23 Nick Jones 2005-02-22 17:53:47 UTC
If there is anything left to fix that's broken, someone please let me know.  I'll try and fix it if I can.  I would like to get netplug into portage soon hopefully...
Comment 24 Pippin 2005-05-02 02:27:02 UTC
Portage complains that Makefile.patch is not in the Manifest. ebuild .. digest fixes. Other than that, it all works fine. Now running as my network service. Oh, although the ebuild should probably patch the man file for netplugd - the files are in the wrong places, really.

My only thought (from what roger was saying) is to maybe have /etc/conf.d/netplug bring up /etc/init.d/net.$dev, so the user decides how to bring the interface up and down the normal way. I've altered my script to do that, and it seems to work fine (although a little slower than calling dhcpcd directly)
Comment 25 Pippin 2005-05-02 09:51:07 UTC
Created attachment 57848 [details]
All files, using /etc/init.d/net.eth? in netplug

I've attached a version in line with my previous comment. Also changed the
Makefile patch to leave prefix as blank, so you don't get //etc turning up in
probe messages at boot
Comment 26 Nick Jones 2005-05-03 11:36:54 UTC
Created attachment 57947 [details]
Full ebuild, patches, and necessary files.

Unpack this file in /usr/local/portage/net-misc and emerge netplug

This ebuild has been modified from the 1.2.7 ebuild to work with the newer
version (1.2.9).  All of the required files to completely install 1.2.7 still
exist.

I am currently running this new version on my laptop without issues via
upgrading.
Comment 27 Roy Marples (RETIRED) gentoo-dev 2005-09-02 04:14:53 UTC
sys-apps/netplug-1.2.9 is now in portage marked ~amd64 and ~x86

It does NOT install an initscript - instead baselayout-1.12.0_pre8 will start
and stop automagically based on the following criteria
1) Has a valid MAC address
2) Does not have an entry in /proc/net/wireless
Comment 28 Roy Marples (RETIRED) gentoo-dev 2005-09-02 11:05:17 UTC
Forgot to mark FIXED