diff options
author | Bernard Cafarelli <voyageur@gentoo.org> | 2008-08-25 18:36:06 +0000 |
---|---|---|
committer | Bernard Cafarelli <voyageur@gentoo.org> | 2008-08-25 18:36:06 +0000 |
commit | 21e19c6cf5e89f47bde8bdf834154decfdc5fd75 (patch) | |
tree | 5bf027859a7991176169bd77e9a7544456864657 /net-misc/nxserver-freenx | |
parent | ppc stable, bug #235298 (diff) | |
download | historical-21e19c6cf5e89f47bde8bdf834154decfdc5fd75.tar.gz historical-21e19c6cf5e89f47bde8bdf834154decfdc5fd75.tar.bz2 historical-21e19c6cf5e89f47bde8bdf834154decfdc5fd75.zip |
Fix round-robin loadbalance, patch from upstream SVN, thanks to Simon Gao <gao@schrodinger.com> in bug #235204
Package-Manager: portage-2.2_rc8/cvs/Linux 2.6.26-gentoo x86_64
Diffstat (limited to 'net-misc/nxserver-freenx')
-rw-r--r-- | net-misc/nxserver-freenx/ChangeLog | 10 | ||||
-rw-r--r-- | net-misc/nxserver-freenx/Manifest | 4 | ||||
-rw-r--r-- | net-misc/nxserver-freenx/files/nxserver-freenx-0.7.3-roundrobin.patch | 143 | ||||
-rw-r--r-- | net-misc/nxserver-freenx/nxserver-freenx-0.7.3-r1.ebuild | 121 |
4 files changed, 276 insertions, 2 deletions
diff --git a/net-misc/nxserver-freenx/ChangeLog b/net-misc/nxserver-freenx/ChangeLog index 14cdc95895fd..df3d1e54be83 100644 --- a/net-misc/nxserver-freenx/ChangeLog +++ b/net-misc/nxserver-freenx/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-misc/nxserver-freenx # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/nxserver-freenx/ChangeLog,v 1.52 2008/08/22 13:04:53 voyageur Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/nxserver-freenx/ChangeLog,v 1.53 2008/08/25 18:36:05 voyageur Exp $ + +*nxserver-freenx-0.7.3-r1 (25 Aug 2008) + + 25 Aug 2008; Bernard Cafarelli <voyageur@gentoo.org> + +files/nxserver-freenx-0.7.3-roundrobin.patch, + +nxserver-freenx-0.7.3-r1.ebuild: + Fix round-robin loadbalance, patch from upstream SVN, thanks to Simon Gao + <gao@schrodinger.com> in bug #235204 *nxserver-freenx-0.7.3 (22 Aug 2008) diff --git a/net-misc/nxserver-freenx/Manifest b/net-misc/nxserver-freenx/Manifest index 5f15053568b4..5d9d44b8acc9 100644 --- a/net-misc/nxserver-freenx/Manifest +++ b/net-misc/nxserver-freenx/Manifest @@ -3,10 +3,12 @@ AUX nxserver-freenx-0.7.2-exitstatus.patch 1015 RMD160 446f7e0fd5317fb0b62ec0e16 AUX nxserver-freenx-0.7.2-nolistentcp.patch 610 RMD160 1a1625bb2b5840cddf0c927567640a32295206d4 SHA1 adcb471f196294aacc682db449dcf94b178b34ba SHA256 e133da25a6a57a8e8097c4eaef4de2d0a1f45919f1d39af822e4c26b9d6b6fdf AUX nxserver-freenx-0.7.2-nxloadconfig.patch 3235 RMD160 a781432921cd62c2c705a83b2efcd76dccf5472d SHA1 6a9e9c8538effd16d4911431fdbcf8200d43a0e6 SHA256 954c77d2629c0c430c036bcedd1ef4be217f73448536378c306b902fa1737666 AUX nxserver-freenx-0.7.3-nxloadconfig.patch 2849 RMD160 fafa9dea7324d2c20dc099242cec34a1b828a920 SHA1 d97f5780a06870441ba2506b0d5cce435f1d9fbc SHA256 8a9c0f16cfd5079cfc055dc7c52b88fb4c5c4c9e45a929189ea6a9c3915ca1de +AUX nxserver-freenx-0.7.3-roundrobin.patch 4130 RMD160 605a87e06ad4626d78abdcfa15ec1f73d3ea0a18 SHA1 c3407eef092b3432c9aba82a6b38e52c45b3dc34 SHA256 4d08d5a75c56f3b976282e191ed8041b6e776fe028f38dce23a2360f911279ed AUX nxserver.init 568 RMD160 a48a0d4853fcd28c0ec6dd2e0366bc69ac1e4b28 SHA1 3980df2e35c594a806b18062e781fa5e52131ff9 SHA256 eda452183da56f6ef5730f1f9e7c968c462b2d3ad31c58ed6100d90c7533c4f2 DIST freenx-server-0.7.2.tar.gz 105394 RMD160 fd962a4d7f26db7d5d7aeb8a169950ce54c88759 SHA1 036a51fb4850007558f41b1968d47c2232ee0315 SHA256 9fea37f0c95a2e9a634dbb1537871ebc3187fce285b8b31d3109e56dc712a6ed DIST freenx-server-0.7.3.tar.gz 114680 RMD160 7a635b2d4796f4ab405c974c881985ea66e8efaf SHA1 888344f946cfb0802e2532e6b93601248c909eb8 SHA256 1afa8a64def93ee95a10f9105de2e6a6ff18076ee187c8ad20b34dc54116a3e4 EBUILD nxserver-freenx-0.7.2-r2.ebuild 3634 RMD160 62ee3e7d5470dfe8eb2c6c49862488c6364c44e3 SHA1 c36ac4bdf75093b71e5ee18df350452508515f72 SHA256 1f6eb34bbbd0deed164d89641695f818fd04376e1b2f02d62460093474b237d8 +EBUILD nxserver-freenx-0.7.3-r1.ebuild 3617 RMD160 4627a052f0da3c701763c26ae4701a92f11f1a43 SHA1 dbfb23a35ef0b5a593baf67e1118b343b5df47c6 SHA256 08c8e4e259a169916199c5181dd4f213fdef8971e1fccad617cf4890054f3342 EBUILD nxserver-freenx-0.7.3.ebuild 3570 RMD160 ab9bd5966e91b44127b510eec6210b9bebf3ad7d SHA1 ca2104b89aa13a9991e361df5a61c2255533bde0 SHA256 cca8e8dd96464b746f1078c36ffdaf45f12f24bfc9a90547220892be5cd22f47 -MISC ChangeLog 12293 RMD160 2824c5421a18e5cd62705bcb4565ae2b1cf65f4b SHA1 3ec28ee559f2a42bc1d59bcd6332d6022259c081 SHA256 315bf8859ad86239a05d1b3be6a6fae185a80ec7e764818890426dd81356ea48 +MISC ChangeLog 12590 RMD160 68f95f8147449b2651044d0599d270fdf3b9c419 SHA1 ca24133c4fc96ec97ac029db9c4de24a88d42baf SHA256 bdb460cbf16a0f1a20cfc8f7f2cd9f7bd182b677dd0e219bdcfd64d6c8824025 MISC metadata.xml 444 RMD160 320adc515fae7b427d477b0aef5175f1b9abf1d7 SHA1 70ec3ac0ab16d652576871bc07970b4799cfe0a0 SHA256 ec5e28af478976bd4ab094f5c4f668d443b82711550d7fd1d320688b4178a4fb diff --git a/net-misc/nxserver-freenx/files/nxserver-freenx-0.7.3-roundrobin.patch b/net-misc/nxserver-freenx/files/nxserver-freenx-0.7.3-roundrobin.patch new file mode 100644 index 000000000000..b584f33df0ed --- /dev/null +++ b/net-misc/nxserver-freenx/files/nxserver-freenx-0.7.3-roundrobin.patch @@ -0,0 +1,143 @@ +--- trunk/freenx-server/nxserver 2008/08/22 00:44:43 580 ++++ trunk/freenx-server/nxserver 2008/08/25 03:28:15 612 +@@ -1192,7 +1192,7 @@ + # Lock held + + SERVER_LB_NR=$(cat $NX_SESS_DIR/round-robin 2>/dev/null) +- let SERVER_LB_NR=(SERVER_LB_NR+1) % SERVER_LB_NR_OF_HOSTS ++ let SERVER_LB_NR=(SERVER_LB_NR+1)%SERVER_LB_NR_OF_HOSTS + echo $SERVER_LB_NR >$NX_SESS_DIR/round-robin + + # Exit critical section +@@ -1961,71 +1961,71 @@ + session_history "$user" "$sessid" + } + +-cmd_terminate() ++cmd_execute() + { +- CMD_PARAMS=$(cmd_parse_3_params "$2") +- [ -z "$CMD_PARAMS" ] && exit 1 +- for i in $CMD_PARAMS; ++ cmd_host="$1" ++ cmd_user="$2" ++ cmd_cmd="$3" ++ ++ if [ "$ENABLE_USERMODE_AUTHENTICATION" = "1" ] ++ then ++ sh -c "$cmd_cmd" ++ elif [ "$cmd_host" = "127.0.0.1" -o "$cmd_host" = "localhost" ] ++ then ++ su - "$cmd_user" -c "$cmd_cmd" ++ else ++ ssh "$cmd_host" su - "$cmd_user" -c "'$cmd_cmd'" ++ fi ++} ++ ++cmd_terminate_or_send() ++{ ++ CMD="$1" ++ ++ if [ "$CMD" = "--broadcast" ] ++ then ++ CMD_PARAMS=$(session_find_all) ++ [ -z "$CMD_PARAMS" ] && cmd_abort "Error: No running session could be found." ++ else ++ CMD_PARAMS=$(cmd_parse_3_params "$2") ++ [ -z "$CMD_PARAMS" ] && exit 1 ++ shift ++ fi ++ shift ++ ++ for i in $CMD_PARAMS + do + CMDLINE=$(session_get_cmdline $i) + cmd_sessionid=$(getparam sessionId) ++ cmd_display=$(getparam display) + cmd_user=$(getparam userName) + cmd_type=$(getparam type) + cmd_status=$(getparam status) ++ cmd_host=$(getparam host) + + # is it a "good" session? +- case "$1" in ++ case "$CMD" in + --suspend) + if [ "$cmd_status" = "Running" ] && stringinstring "unix-" "$cmd_type" + then +- echo "sessionid=$cmd_sessionid" | su - "$cmd_user" -c "$PATH_BIN/nxnode --suspend" ++ echo "sessionid=$cmd_sessionid" | cmd_execute "$cmd_host" "$cmd_user" "$PATH_BIN/nxnode --suspend" + fi + ;; + --terminate) +- echo "sessionid=$cmd_sessionid" | su - "$cmd_user" -c "$PATH_BIN/nxnode --terminate" ++ echo "sessionid=$cmd_sessionid" | cmd_execute "$cmd_host" "$cmd_user" "$PATH_BIN/nxnode --terminate" + ;; + --force-terminate) +- echo "sessionid=$cmd_sessionid" | su - "$cmd_user" -c "$PATH_BIN/nxnode --terminate" ++ echo "sessionid=$cmd_sessionid" | cmd_execute "$cmd_host" "$cmd_user" "$PATH_BIN/nxnode --terminate" + session_close $cmd_sessionid + ;; +- esac +- done +- +-} +- +-cmd_send() +-{ +- if [ "$1" = "--broadcast" ] +- then +- CMD_PARAMS=$(session_find_all) +- [ -z "$CMD_PARAMS" ] && cmd_abort "Error: No running session could be found." +- else +- CMD_PARAMS=$(cmd_parse_3_params "$2") +- [ -z "$CMD_PARAMS" ] && exit 1 +- shift +- fi +- shift +- for i in $CMD_PARAMS; +- do +- CMDLINE=$(session_get_cmdline $i) +- cmd_display=$(getparam display) +- cmd_user=$(getparam userName) +- cmd_type=$(getparam type) +- cmd_status=$(getparam status) +- cmd_host=$(getparam host) +- +- # is it a "good" session? +- if [ "$cmd_status" = "Running" ] && stringinstring "unix-" "$cmd_type" +- then +- if [ "$cmd_host" = "127.0.0.1" -o "$cmd_host" = "localhost" ] ++ --send|--broadcast) ++ # is it a "good" session? ++ if [ "$cmd_status" = "Running" ] && stringinstring "unix-" "$cmd_type" + then +- su - "$cmd_user" -c "$PATH_BIN/nxdialog --dialog ok --caption \"NX Administrator Message\" --message \"$@\" -display \":$cmd_display\" &" +- else +- ssh $cmd_host su - "$cmd_user" -c "'$PATH_BIN/nxdialog --dialog ok --caption \"NX Administrator Message\" --message \"$@\" -display \":$cmd_display\" &'" ++ cmd_execute "$cmd_host" "$cmd_user" "$PATH_BIN/nxdialog --dialog ok --caption \"NX Administrator Message\" --message \"$@\" -display \":$cmd_display\" &" + fi +- fi ++ esac + done +- #nxnode_start --send "$CMD_PARAMS" + } + + # +@@ -2099,13 +2099,13 @@ + cmd_history "$@" + ;; + --terminate|--suspend|--force-terminate) +- cmd_terminate "$@" ++ cmd_terminate_or_send "$@" + ;; + --cleanup) +- cmd_terminate "--force-terminate" "*" ++ cmd_terminate_or_send "--force-terminate" "*" + ;; + --send|--broadcast) +- cmd_send "$@" ++ cmd_terminate_or_send "$@" + ;; + *) + cmd_abort "Error: Function $CMD not implemented yet." diff --git a/net-misc/nxserver-freenx/nxserver-freenx-0.7.3-r1.ebuild b/net-misc/nxserver-freenx/nxserver-freenx-0.7.3-r1.ebuild new file mode 100644 index 000000000000..7a1ff342b767 --- /dev/null +++ b/net-misc/nxserver-freenx/nxserver-freenx-0.7.3-r1.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/nxserver-freenx/nxserver-freenx-0.7.3-r1.ebuild,v 1.1 2008/08/25 18:36:05 voyageur Exp $ + +inherit multilib eutils + +MY_PN="freenx-server" +DESCRIPTION="Free Software Implementation of the NX Server" +HOMEPAGE="http://freenx.berlios.de/" +SRC_URI="mirror://berlios/freenx/${MY_PN}-${PV}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +RESTRICT="strip" +IUSE="arts cups esd nxclient" +DEPEND="virtual/ssh + dev-tcltk/expect + sys-apps/gawk + net-analyzer/gnu-netcat + nxclient? ( net-misc/nxclient ) + !nxclient? ( !net-misc/nxclient + || ( x11-misc/xdialog + x11-apps/xmessage ) ) + >=net-misc/nx-2.1.0 + arts? ( kde-base/arts ) + cups? ( net-print/cups ) + esd? ( media-sound/esound ) + !net-misc/nxserver-freeedition + !net-misc/nxserver-2xterminalserver" + +RDEPEND="${DEPEND} + media-fonts/font-misc-misc + media-fonts/font-cursor-misc + x11-apps/xauth + x11-apps/xrdb + x11-apps/sessreg" + +S=${WORKDIR}/${MY_PN}-${PV} + +export NX_HOME_DIR=/var/lib/nxserver/home + +pkg_setup () { + enewuser nx -1 -1 ${NX_HOME_DIR} +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${P}-nxloadconfig.patch + epatch "${FILESDIR}"/${P}-roundrobin.patch + epatch "${FILESDIR}"/${PN}-0.7.2-cups.patch + + sed -i "/PATH_LIB=/s/lib/$(get_libdir)/g" nxloadconfig || die + sed -i "/REAL_PATH_BIN=/s/lib/$(get_libdir)/g" nxloadconfig || die + + # Change the defaults in nxloadconfig to meet the users needs. + if use arts ; then + einfo "Enabling arts support." + sed -i '/ENABLE_ARTSD_PRELOAD=/s/"0"/"1"/' nxloadconfig || die + sed -i '/ENABLE_ARTSD_PRELOAD=/s/"0"/"1"/' node.conf.sample || die + fi + if use esd ; then + einfo "Enabling esd support." + sed -i '/ENABLE_ESD_PRELOAD=/s/"0"/"1"/' nxloadconfig || die + sed -i '/ENABLE_ESD_PRELOAD=/s/"0"/"1"/' node.conf.sample || die + fi + if use cups ; then + einfo "Enabling cups support." + sed -i '/ENABLE_KDE_CUPS=/s/"0"/"1"/' nxloadconfig || die + sed -i '/ENABLE_KDE_CUPS=/s/"0"/"1"/' node.conf.sample || die + fi +} + +src_install() { + export NX_ETC_DIR=/etc/nxserver + export NX_SESS_DIR=/var/lib/nxserver/db + + emake DESTDIR="${D}" install || die "install failed" + + # This should be renamed to remove the blocker on net-misc/nxclient + use nxclient && rm "${D}"/usr/bin/nxprint + + mv "${D}"/etc/nxserver/node.conf.sample "${D}"/etc/nxserver/node.conf || + die "cannot find default configuration file" + + dodir ${NX_ETC_DIR} + for x in passwords passwords.orig ; do + touch "${D}"${NX_ETC_DIR}/$x + chmod 600 "${D}"${NX_ETC_DIR}/$x + done + + dodir ${NX_HOME_DIR} + + for x in closed running failed ; do + keepdir ${NX_SESS_DIR}/$x + fperms 0700 ${NX_SESS_DIR}/$x + done + + newinitd "${FILESDIR}"/nxserver.init nxserver +} + +pkg_postinst () { + # Other NX servers ebuilds may have already created the nx account + # However they use different login shell/home directory paths + if [[ ${ROOT} == "/" ]]; then + usermod -s /usr/bin/nxserver nx || die "Unable to set login shell of nx user!!" + usermod -d ${NX_HOME_DIR} nx || die "Unable to set home directory of nx user!!" + usermod -G utmp nx || die "Unable to add nx user to utmp group!!" + else + elog "If you had another NX server installed before, please make sure" + elog "the nx user account is correctly set to:" + elog " * login shell: /usr/bin/nxserver" + elog " * home directory: ${NX_HOME_DIR}" + elog " * supplementary groups: utmp" + fi + + elog "To complete the installation, run:" + elog " nxsetup --install --setup-nomachine-key --clean --purge" + elog "This will use the default Nomachine SSH key" +} |