summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-06-30 21:48:29 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-06-30 21:48:29 +0000
commit6f20377b6fdf63cccc433ed684fbf91430c57a40 (patch)
treedf48d485be4319b2d53a6bbb943cc07cffdceab3
parentd739dbe9cc205ad0cfd08f7075bc16ff1b94fed9 (diff)
downloadpfsense-6f20377b6fdf63cccc433ed684fbf91430c57a40.zip
pfsense-6f20377b6fdf63cccc433ed684fbf91430c57a40.tar.gz
Correctly move upnp to base since LiveCD cannot write files to /usr/local/etc or /usr/local/etc/rc.d/ Ticket #1342
-rw-r--r--etc/inc/services.inc6
-rwxr-xr-xetc/rc.bootup2
-rw-r--r--usr/local/pkg/miniupnpd.inc31
3 files changed, 9 insertions, 30 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index c268f98..4bc0d1f 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -1272,4 +1272,10 @@ function configure_cron() {
conf_mount_ro();
}
+function upnp_start() {
+ if($config['installedpackages']['miniupnpd']['config'][0]["enable"]) {
+ mwexec_bg("/usr/local/sbin/miniupnpd -f /var/etc/miniupnpd.conf");
+ }
+}
+
?> \ No newline at end of file
diff --git a/etc/rc.bootup b/etc/rc.bootup
index 7a00960..7d1bafd 100755
--- a/etc/rc.bootup
+++ b/etc/rc.bootup
@@ -317,6 +317,8 @@
mwexec("sysctl net.inet.tcp.sendspace=4096");
}
+ upnp_start();
+
/* done */
unlink("{$g['varrun_path']}/booting");
$g['booting'] = FALSE;
diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc
index 8d4e1a0..5a2c543 100644
--- a/usr/local/pkg/miniupnpd.inc
+++ b/usr/local/pkg/miniupnpd.inc
@@ -5,7 +5,7 @@
/* MiniUPnPd */
define('UPNP_RCFILE', '/usr/local/etc/rc.d/miniupnpd.sh');
- define('UPNP_CONFIG','/usr/local/etc/miniupnpd.conf');
+ define('UPNP_CONFIG','/var/etc/miniupnpd.conf');
function upnp_notice ($msg) { syslog(LOG_NOTICE, "miniupnpd: {$msg}"); return; }
function upnp_warn ($msg) { syslog(LOG_WARNING, "miniupnpd: {$msg}"); return; }
@@ -221,35 +221,6 @@
if(upnp_config('permdefault'))
$configtext .= "deny 0-65535 0.0.0.0/0 0-65535\n";
- /* generate rc file start and stop */
- $stop = <<<EOD
-if [ `pgrep miniupnpd | wc -l` != 0 ]; then
- /usr/bin/killall miniupnpd
- while [ `pgrep miniupnpd | wc -l` != 0 ]; do
- sleep 1
- done
- fi
- # Clear existing rules and rdr entries
- if [ `pfctl -aminiupnpd -sr | wc -l` != 0 ]; then
- /sbin/pfctl -aminiupnpd -Fr 2>&1 >/dev/null
- fi
- if [ `pfctl -aminiupnpd -sn | wc -l` != 0 ]; then
- /sbin/pfctl -aminiupnpd -Fn 2>&1 >/dev/null
- fi
-EOD;
- $start = $stop."\n\t/usr/local/sbin/miniupnpd -f ".UPNP_CONFIG;
-
- /* write out the configuration */
- conf_mount_rw();
- upnp_write_config(UPNP_CONFIG,$configtext);
- write_rcfile(array(
- 'file' => 'miniupnpd.sh',
- 'start' => $start,
- 'stop' => $stop
- )
- );
- conf_mount_ro();
-
/* if miniupnpd not running start it */
if(!upnp_running()) {
upnp_notice("Starting service on interface: {$ifaces_active}");
OpenPOWER on IntegriCloud