aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-03-27 16:38:51 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-03-27 16:38:51 -0300
commitbabc54b9d664fd29f562d87cc7f9a02c6414fa7a (patch)
tree31862a80bff52ddaac546ebdb96bb2008a7e099d
parent3c555e74abb2833a61bda5525a16a261c5bb5ab4 (diff)
parent8a344ecccd0f111562804d4a01828386458c7fb6 (diff)
downloadpfsense-packages-babc54b9d664fd29f562d87cc7f9a02c6414fa7a.tar.gz
pfsense-packages-babc54b9d664fd29f562d87cc7f9a02c6414fa7a.tar.bz2
pfsense-packages-babc54b9d664fd29f562d87cc7f9a02c6414fa7a.zip
Merge pull request #839 from k-paulius/fix-4337
-rw-r--r--config/freeradius2/freeradius.inc37
-rw-r--r--pkg_config.10.xml2
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
4 files changed, 39 insertions, 4 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc
index df231821..00076816 100644
--- a/config/freeradius2/freeradius.inc
+++ b/config/freeradius2/freeradius.inc
@@ -134,7 +134,42 @@ function freeradius_install_command() {
$rcfile = array();
$rcfile['file'] = 'radiusd.sh';
- $rcfile['start'] = FREERADIUS_ETC . '/rc.d/radiusd onestart';
+ $freeradius_etc_dir = FREERADIUS_ETC;
+ $rcfile['start'] = <<<EOD
+SERVICENAME="radiusd"
+ LOCKFILE="/tmp/\${SERVICENAME}_start.lock"
+ PIDFILE="/var/run/\${SERVICENAME}.pid"
+
+ # prevent this part of script from running in parallel
+ if ( set -o noclobber; echo "\$\$" > "\$LOCKFILE") 2> /dev/null; then
+ # make sure lock file is removed even if script is terminated
+ trap 'rm -f "\$LOCKFILE"; exit \$?' INT TERM EXIT
+
+ {$freeradius_etc_dir}/rc.d/radiusd onestart
+
+ # try to wait until the service starts
+ if [ ! -f "\$PIDFILE" ]; then
+ echo "\$SERVICENAME.sh: PID file was not found"
+
+ for i in 1 2 3 4 5; do
+ if [ -f "\$PIDFILE" ]; then
+ echo "\$SERVICENAME.sh: Service started PID: `cat \$PIDFILE`"
+ break
+ else
+ echo "\$SERVICENAME.sh: Waiting 0.5 seconds"
+ sleep 0.5
+ fi
+ done
+ else
+ echo "\$SERVICENAME.sh: Service running PID: `cat \$PIDFILE`"
+ fi
+
+ rm -f "\$LOCKFILE"
+ trap - INT TERM EXIT
+ else
+ echo "\$SERVICENAME.sh: Cannot continue at this moment, this script is already trying to start service PID: \$(cat \$LOCKFILE)"
+ fi
+EOD;
$rcfile['stop'] = FREERADIUS_ETC . '/rc.d/radiusd onestop';
write_rcfile($rcfile);
conf_mount_ro();
diff --git a/pkg_config.10.xml b/pkg_config.10.xml
index 1dbb004f..e7e9472d 100644
--- a/pkg_config.10.xml
+++ b/pkg_config.10.xml
@@ -788,7 +788,7 @@
On pfSense docs there is a how-to which could help you on porting users.]]></descr>
<pkginfolink>https://doc.pfsense.org/index.php/FreeRADIUS_2.x_package</pkginfolink>
<category>System</category>
- <version>2.1.12_1/2.2.6_3 pkg v1.6.10</version>
+ <version>2.2.6_3 pkg v1.6.11</version>
<status>RC1</status>
<required_version>2.2</required_version>
<maintainer>nachtfalkeaw@web.de</maintainer>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 88da6df0..43dfecab 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -1041,7 +1041,7 @@
On pfSense docs there is a how-to which could help you on porting users.]]></descr>
<pkginfolink>https://doc.pfsense.org/index.php/FreeRADIUS_2.x_package</pkginfolink>
<category>System</category>
- <version>2.1.12_1/2.2.5_3 pkg v1.6.10</version>
+ <version>2.2.5_3 pkg v1.6.11</version>
<status>RC1</status>
<required_version>2.1</required_version>
<maintainer>nachtfalkeaw@web.de</maintainer>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index 31ae8cde..84366e26 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -1028,7 +1028,7 @@
On pfSense docs there is a how-to which could help you on porting users.]]></descr>
<pkginfolink>https://doc.pfsense.org/index.php/FreeRADIUS_2.x_package</pkginfolink>
<category>System</category>
- <version>2.1.12_1/2.2.5_3 pkg v1.6.10</version>
+ <version>2.2.5_3 pkg v1.6.11</version>
<status>RC1</status>
<required_version>2.1</required_version>
<maintainer>nachtfalkeaw@web.de</maintainer>