Summary: | sys-apps/openrc-0.9.8.2: net.* are not stopped while shutting down | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Miguel Sanjurjo <miguel> |
Component: | OpenRC | Assignee: | OpenRC Team <openrc> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | martin |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | openrc:oldnet | ||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 399185, 401555, 401593 | ||
Attachments: | doc.patch |
Description
Miguel Sanjurjo
2012-01-29 09:39:09 UTC
This is related to commit 6d5a2d5f9e5c1e3cb4c24dfc0c2ed2c118d8e64c - http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=6d5a2d5f9e5c1e3cb4c24dfc0c2ed2c118d8e64c I can't think of a reason that yu would need your network interfaces to actually go down when you are shutting down your system. However, I will look over the script and see if I can make it behave the same way the network script does. By the way, /etc/init.d/network should not be used; that script, along with /etc/init.d/staticroute, is deprecated and being removed in the future. when you are (In reply to comment #2) > I can't think of a reason that yu would need your network interfaces to > actually go down when you are shutting down your system. However, I will > look over the script and see if I can make it behave the same way the > network script does. I explained this in the bug description: Some NICs need the WOL-Settings applied after network disconnection. The postdown() section of a net.* script, called while shutting down the system, is ideal for that. > By the way, /etc/init.d/network should not be used; that script, along > with /etc/init.d/staticroute, is deprecated and being removed in the > future. > when you are Yes, I know they are deprecated. Thanks for the hint Christian Ruppert. Removing the "-shutdown" keyword from /etc/init.d/net.lo did the trick. The scripts are behaving like they should again (In reply to comment #2) > I can't think of a reason that yu would need your network interfaces to > actually go down when you are shutting down your system. Here is another reason for net.ppp* (though I have not checked whether the problem appears here, too): pppd reports the number of transferred bytes and connection time at disconnection. With some providers, it can be quite expensive to go over a certain limit of transferred data or connection time, so this information must be carefully logged. For a simple solution, a script in /etc/ppp/ip-down.d is appropriate. This does not work if pppd does not go down regularly. (In reply to comment #3) > (In reply to comment #2) > > I can't think of a reason that yu would need your network interfaces to > > actually go down when you are shutting down your system. However, I will > > look over the script and see if I can make it behave the same way the > > network script does. > > I explained this in the bug description: > Some NICs need the WOL-Settings applied after network disconnection. The > postdown() section of a net.* script, called while shutting down the system, is > ideal for that. > Thanks for the hint Christian Ruppert. Removing the "-shutdown" keyword from > /etc/init.d/net.lo did the trick. The scripts are behaving like they should > again Actually, you should do this without touching /etc/init.d/net.lo, as follows: For the interfaces you need to keep up, place the following in /etc/conf.d/net: rc_net_IFNAME_keyword="!-shutdown" (In reply to comment #4) > Here is another reason for net.ppp* (though I have not checked whether > the problem appears here, too): > pppd reports the number of transferred bytes and connection time at > disconnection. With some providers, it can be quite expensive to go > over a certain limit of transferred data or connection time, so this > information must be carefully logged. > For a simple solution, a script in /etc/ppp/ip-down.d is appropriate. > This does not work if pppd does not go down regularly. pppd going down is different from the ppp* interface going down. What the change does is not bring down the ppp* interfaces on shutdown, but, the pppd daemon will still be killed as usual. Does that not bring down the connection? @robbat2: I spoke with some folks on #gentoo-dev before I implemented this change and was told that it would be a positive/neutral change. I have a patch which I will attach here that shows what would need to change in the documentation for folks who want to still have their interfaces go down. Do you think we should go forward and commit the doc change or revert this commit so that all of the network interfaces always go down again? Created attachment 300335 [details]
doc.patch
Here is the doc change.
(In reply to comment #5) > I spoke with some folks on #gentoo-dev before I implemented this change and was > told that it would be a positive/neutral change. Just curiosity: What is positive about this change? (In reply to comment #6) > Created attachment 300335 [details] > doc.patch > > Here is the doc change. That reference to rc_net_IFNAME_keyword="!-shutdown" is good, it should have been added in the same commit as the change. Thanks for that (In reply to comment #5) > pppd going down is different from the ppp* interface going down. What the > change does is not bring down the ppp* interfaces on shutdown, but, the pppd > daemon will still be killed as usual. I cannot access my system at the moment, but if I understand correctly you rely on pppd being killed when all processes are killed. If this is the case, this has at least two problems: 1. Unless the behavior of pppd has changed recently, this will not call /etc/ppp/ip-down. For the latter, pppd must be shut down "regularly" (I do not know how openrc is doing this currently; perhaps by sending a SIGHUP (not a SIGTERM). 2. What is more serious: Does this mean that a temporary /etc/init.d/net.ppp0 stop does not stop the connection either, i.e. to stop the connection you have to send SIGHUP to pppd manually and to restart it later you have to start pppd manually? This also means that all other dependent init-scripts (like starting/stopping ez-ipupdate, openrdate, or similar things) will also not work correspondingly with stop/start. If this is the case, I am afraid that this means openrc can practically not be used anymore for pppd or other non-permanent connections but has to replaced completely by home-brewn scripts... (In reply to comment #8) > I cannot access my system at the moment, but if I understand correctly > you rely on pppd being killed when all processes are killed. > If this is the case, this has at least two problems: > > 1. Unless the behavior of pppd has changed recently, > this will not call /etc/ppp/ip-down. For the latter, pppd must be shut down > "regularly" (I do not know how openrc is doing this currently; perhaps by > sending a SIGHUP (not a SIGTERM). Openrc sends SIGTERM initially to ask the process to shut down, then it sends SIGKILL after 5 seconds to make it go down. Does pppd require a SIGHUP instead? If so, I may be able to make ppp interfaces go down. > 2. What is more serious: Does this mean that a temporary > /etc/init.d/net.ppp0 stop does not stop the connection either, > i.e. to stop the connection you have to send SIGHUP to pppd manually > and to restart it later you have to start pppd manually? > This also means that all other dependent init-scripts > (like starting/stopping ez-ipupdate, openrdate, or similar things) will also > not work correspondingly with stop/start. > If this is the case, I am afraid that this means openrc can practically not > be used anymore for pppd or other non-permanent connections but has to > replaced completely by home-brewn scripts... No, the only thing this does is not take interfaces down when you shut down your system. This is reverted in commits 8a41537 and 0ff23f2. Openrc-0.9.8.3 will be released asap. |