UPnP support
-
Wow …
Oct 5 17:09:05 last message repeated 23845 times
Oct 5 17:08:34 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:34 miniupnpd[1359]: recv (state0): Connection reset by peer
Oct 5 17:08:34 last message repeated 5583 times
Oct 5 17:08:27 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:27 miniupnpd[1359]: recv (state0): Connection reset by peerIs this a new error or is the error just being displayed now. It has completely filled my system log in 15 min. Also the firewall log still fills with accepted packets.
What is UPNP communicating with? XBOX?
-
Wow …
Oct 5 17:09:05 last message repeated 23845 times
Oct 5 17:08:34 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:34 miniupnpd[1359]: recv (state0): Connection reset by peer
Oct 5 17:08:34 last message repeated 5583 times
Oct 5 17:08:27 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:27 miniupnpd[1359]: recv (state0): Connection reset by peerIs this a new error or is the error just being displayed now. It has completely filled my system log in 15 min. Also the firewall log still fills with accepted packets.
What is UPNP communicating with? XBOX?
Nope I just had Azereus open. Just like in the past with the older version. This is a clean RC3 install with a,b,c patches and the miniupnpd package.
-
Ruh roh. Looks like the new miniupnpd binary has added a regression then.
-
Ruh roh. Looks like the new miniupnpd binary has added a regression then.
I'd say so. I loaded the old binary version back and the error is gone.
-
Embedded users interested in this package have a look at http://forum.pfsense.org/index.php/topic,1788.msg13490.html#msg13490 :)
-
Upgraded and …
Oct 4 08:09:40 miniupnpd[1423]: Unknown soap method Oct 4 08:25:08 miniupnpd[1423]: Unknown soap method Oct 4 08:47:17 miniupnpd[1423]: Unknown soap method Oct 4 09:26:39 miniupnpd[1423]: Unknown soap method
-
Looks like something is dirty if it needs soap… ;D
-
From my post referenced above about adding miniupnpd on embedded.
http://forum.pfsense.org/index.php/topic,1788.msg13498.html#msg13498
Miniupnpd uses the miniupnp.sh script to start the service. This file contains your ip address and nic interface hardcoded. Not a big deal as the sync_package_miniupnpd() recreates it. However it doesn't seem to run this when syncing packages at startup. I looked in the code and it looks like the miniupnpd.xml file should have a custom_php_resync_config_command section which calles sync_package_miniupnpd(). I think the thought was that once its configured theres really no need to keep recreating the same startup file.
Shouldn't the below be added to the miniupnpd.xml file so the package is resynced at startup. Wouldn't hardly add any extra time to boot and would insure the package is configured properly.
<custom_php_resync_config_command>sync_package_miniupnpd();</custom_php_resync_config_command>
I could be wrong but I looked into the pfsense-utils.inc file and don't see how this would get called without the above xml section.
-
Hmm I have the latest version with that has the custom_php_resync_config_command added in the xml file. I receive the following error.
Syncing packages:
miniupnpdFatal error: Call to undefined function: get_real_wan_interface() in /usr/local/pkg/miniupnpd.inc on line 13
Executing rc.d items…
Starting /usr/local/etc/rc.d/*.sh... -
Try to reinstall the package. I just commited a change.
-
Try to reinstall the package. I just commited a change.
Well were making progress. I figured it was something as simple as including a file. Although now it stops here.
Warning: Invalid argument supplied for foreach() in /usr/local/pkg/miniupnpd.inc on line 28
foreach($_POST['interface_array'] as $iface) {
The issue is there is no post data. However it really comes down to an overthoght in the coding. Since the inferface_array is either pulled form the post data or the config. My thought is it should just read
foreach($interface_array as $iface) {
Since the if statement above is setting $interface_array = $_POST['interface_array']; it should still contain the array and properly go through each interface.
Also shouldn't the start_service("miniupnpd"); line be included in the if statment. If theres no interface array and no file is generated why should we start the service?
I'm going to make these changes on mine and see what happens. Will report back soon.
-
Alright with the above changes it works great now. No errors. I can see why pfSense takes so long to get to release 1.0. Lots of easily overlooked things that show up and to have to track them down and fix them all has go to be a major pain.
-
There is still a bug where it is resyncing packages twice causing issues. It you look at the log it takes longer for miniupnpd to exit than it does for the new one to start. Is there a way to make killall miniupnpd in the miniupnpd.sh file wait until it actually exits before proceeding?
Oct 7 00:58:56 check_reload_status: updating dyndns
Oct 7 00:58:42 check_reload_status: reloading filter
Oct 7 00:58:42 miniupnpd[1106]: Failed to open socket for SSDP. EXITING
Oct 7 00:58:42 miniupnpd[1106]: bind(udp): Address already in use
Oct 7 00:58:42 miniupnpd[1092]: received signal 15, exiting
Oct 7 00:58:35 php: : Resyncing configuration for all packages.
Oct 7 00:58:30 php: : Creating rrd graph index
Oct 7 00:58:30 php: : Creating rrd update script
Oct 7 00:58:30 php: : Informational: DHClient spawned /etc/rc.newwanip and the new ip is wan - 68.100.53.135.
Oct 7 00:58:21 login: login on console as root
Oct 7 00:58:01 sshlockout[868]: sshlockout starting up
Oct 7 00:58:01 sshlockout[868]: sshlockout starting up
Oct 7 00:58:01 login: login on console as root
Oct 7 00:57:50 check_reload_status: rc.newwanip starting
Oct 7 00:57:50 check_reload_status: check_reload_status is starting
Oct 7 00:57:44 miniupnpd[804]: received signal 15, exiting
Oct 7 00:57:44 miniupnpd[820]: Failed to open socket for SSDP. EXITING
Oct 7 00:57:44 miniupnpd[820]: bind(udp): Address already in use
Oct 7 00:57:43 miniupnpd[804]: Unknown soap method
Oct 7 00:57:43 miniupnpd[804]: Unknown soap method
Oct 7 00:57:37 dnsmasq[567]: reading /var/dhcpd/var/db/dhcpd.leases
Oct 7 00:57:36 php: : Resyncing configuration for all packages. -
Hopefully both problems have been addressed now.
-
Yep you got them. Works great.
-
I was wondering if you'd be willing to commit this to the miniupnpd.inc file. Instead of just waiting blindly it checks and loops until all the miniupnpd processes are killed. I have tested it and it works.
It counts the number of lines returned by ps relating to /usr/local/sbin/miniupnpd. If its not equal to 0 then we know miniupnpd is still running.
$start = "# Clear existing rules and rdr entries \n";
$start .= "/sbin/pfctl -aminiupnpd -Fr 2>&1 >/dev/null\n";
$start .= "/sbin/pfctl -aminiupnpd -Fn 2>&1 >/dev/null\n";
$start .= "/usr/bin/killall miniupnpd\n";
$start .= "while [ps -A | grep /usr/local/sbin/miniupnpd | grep -v grep | wc -l
!= 0 ]; do sleep 1; done\n";
$start .= "/usr/local/sbin/miniupnpd -p 2869{$ifaces_final}"; -
One more adition to miniupnpd.inc that I found usefull on mine. We only need to run the start_service command if the serivce is not running or if the user changes the settings.
Othewise everytime the wan dhcp is updated the service is restarted. This is unecessary as only the wan interface NAME is used not the IP. For the -o override the ip is going to be static so it won't change. Plus it causes downtime with apps and game consoles, which can be bothersome.
Also this speeds up the boot process as the service won't be restarted numerous times. It starts once and gets restarted once when the rc file is called.
/* if not ONE instance running lets start /
/ or if $_POST data as user is changing settings */
if((int)exec("ps -A | grep /usr/local/sbin/miniupnpd | grep -v grep | wc -l") != 1 || $_POST['interface_array']) {
start_service("miniupnpd");
}EDIT – I spoke to soon its still restarting when dhcp renewed. Wonder where it is getting called from? I'm using the following code
/* if not ONE instance running lets start /
/ or if $_POST data as user is changing settings */
if((int)exec("ps -A | grep /usr/local/sbin/miniupnpd | grep -v grep | wc -l") != 1 || $_POST['interface_array']) {
log_error("miniupnpd resync package: start");
start_service("miniupnpd");
} else {
log_error("miniupnpd resync package: none");
}and am getting this in my log
Oct 7 16:08:19 miniupnpd[4067]: Unknown soap method
Oct 7 16:08:17 check_reload_status: reloading filter
Oct 7 16:08:16 miniupnpd[3242]: received signal 15, exiting
Oct 7 16:08:15 php: : miniupnpd resync package: none
So I wonder where its getting called from. Reguardless it would've restarted twice instead of once without it -
Provide a patch in diff -rub format for all of your recent posts. At this point its becoming hard to follow you.
-
Provide a patch in diff -rub format for all of your recent posts. At this point its becoming hard to follow you.
I think this is what you want.
miniupnpd.inc
36a37 > 40c41,43 < $start .= "killall miniupnpd; sleep 3; /usr/local/sbin/miniupnpd -p 2869{$ifaces_final}"; --- > $start .= "/usr/bin/killall miniupnpd\n"; > $start .= "while [ `ps -A | grep /usr/local/sbin/miniupnpd | grep -v grep | wc -l` != 0 ]; do sleep 1; done\n"; > $start .= "/usr/local/sbin/miniupnpd -p 2869{$ifaces_final}"; 57c60,66 < start_service("miniupnpd"); --- > > /* if not ONE instance running lets start */ > /* or if $_POST data as user is changing settings */ > if((int)exec("ps -A | grep /usr/local/sbin/miniupnpd | grep -v grep | wc -l") != 1 || $_POST['interface_array']) { > start_service("miniupnpd"); > } > 61c70 < ?> \ No newline at end of file --- > ?>
-
diff -rub