--- scripts/setup/nxserver.orig 2007-11-21 19:08:47.000000000 +0100 +++ scripts/setup/nxserver 2007-11-30 10:57:41.430044132 +0100 @@ -598,6 +598,10 @@ removeNXinit () { + if [ "$system" = "gentoo" ]; then + return + fi + runCommand "$RMCOMMAND -f /etc/init.d/nxserver" "Unable to remove '/etc/init.d/nxserver'" "warn" if [ "$system" = "solaris" ]; @@ -744,6 +748,10 @@ addNXinit () { + if [ "$system" = "gentoo" ]; then + return + fi + runCommand "cat $NODE_ROOT/scripts/init/nxserver > /etc/init.d/nxserver" "Unable to create: '/etc/init.d/nxserver'" "warn" runCommand "chmod +x /etc/init.d/nxserver" "Cannot set permissions of '/etc/init.d/nxserver' file" "warn" @@ -858,6 +866,12 @@ } addNXUserLinux () { + + # does the NX user already exist? + if id nx > /dev/null 2>&1 ; then + return + fi + if [ "x$system" != "xdebian" ] then sysuser=`useradd --help 2>&1|grep "\-r"`; @@ -2515,6 +2529,11 @@ system=fedora fi +if [ -d /usr/portage ]; +then + system=gentoo +fi + if [ "x$system" = "x" -a -f /etc/release ]; then system=solaris @@ -2549,6 +2568,7 @@ "mandrake" ) ;; "fedora" ) ;; "debian" ) ;; + "gentoo" ) ;; "solaris" ) ;; "" ) ARGS=-1 && errMsg="$PREFIX $ERROR ERROR: Unable to autodetect the operating system type, please specify it" ;; * ) ARGS=-1 && errMsg="$PREFIX $ERROR ERROR: Unsupported operating system '$system'" ;; @@ -2701,21 +2721,6 @@ fi fi - - result=`id nx 2>&1` - if [ $? = 0 ]; - then -# printMsg "Cannot add user: nx. User: nx already exists" "error" -# printMsg "Please try to fix the problem by reinstalling the server" "error" - printMsg "Cannot add user: nx" "error" - printMsg "User: nx already exists" "error" - printMsgNoDot "To fix the problem, you may try to completely uninstall NX" - printMsgNoDot "Server and install it from scratch. If this is not enough," - printMsgNoDot "please delete the nx user by using the system commands and" - printMsg "proceed with a new installation of NX Server" - exit 1 - fi - LOGFILE="$INSTALLOG" createLogdirectory startLog