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.
Created attachment 43247 [details] Initial netplug 1.2.7 ebuild.
Created attachment 43248 [details] ChangeLog
Created attachment 43249 [details] Manifest
Created attachment 43250 [details] Metadata
Created attachment 43251 [details, diff] Makefile patch to fix install commands
Created attachment 43252 [details] digest for the tarball from the author's website
Created attachment 43253 [details, diff] Fixes probing and runs dhcpcd when "alive" and kills dhcpcd nicely when disconnected.
Created attachment 43254 [details, diff] Nukes the original init script and replaces it with a Gentoo init script modeled off of proftpd
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.
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?
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?
Created attachment 43282 [details] cleaned up ebuild
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.
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.
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?
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! ;-)
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).
Created attachment 49241 [details, diff] fixed up Makefile to drop to the right names/locations
Created attachment 49242 [details, diff] fixed inning/outing/probing script
Created attachment 49243 [details, diff] gentoo style init script patch
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.
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.
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...
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)
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
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.
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
Forgot to mark FIXED