summaryrefslogtreecommitdiff
blob: 711646aa5090c24f456e8c4be62831ba6d1e7da1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
--- server/nxnode/setup/nxsetup.orig	2007-03-10 16:25:56.000000000 +0100
+++ server/nxnode/setup/nxsetup	2007-03-10 16:26:38.000000000 +0100
@@ -840,6 +840,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" ];
@@ -896,6 +900,9 @@
       then
       runCommand "$RMCOMMAND -f /etc/rc0.d/K99nxserver" "Unable to remove '/etc/rc0.d/K99nxserver'" "warn"
       fi
+  elif [ "$system" = "gentoo" ]; then
+    # do nothing; this is handled by Gentoo ebuild
+    echo > /dev/null
   else
       if [ -f /etc/rc.d/rc3.d/S99nxserver ];
       then
@@ -919,6 +926,10 @@
 
 
 addNXinit () {
+ 
+ if [ "$system" = "gentoo" ] ; then
+   return;
+ fi
 
  runCommand "cat /usr/NX/scripts/restricted/nxaddinitd.sh > /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"
@@ -994,6 +1005,11 @@
 }
 
 addNXSystemSetup () {
+  
+  if [ "$system" = "gentoo" ]; then
+    return
+  fi
+
   if [ -f "$rcBash" ];
   then
     grep "#$NX_SETUP_VERSION" "$rcBash" 1>/dev/null
@@ -1064,6 +1080,10 @@
 }
 
 addNXUserLinux () {
+  # does the NX user already exist?
+  if id nx > /dev/null 2>&1 ; then
+    return
+  fi
 
   if [ "x$system" = "xmandrake" -o "x$system" = "xfedora" ];
   then
@@ -1909,6 +1929,10 @@
   system=fedora
 fi
 
+if [ -d /usr/portage ]; then
+  system=gentoo
+fi
+
 if [ "x$system" = "x" -a -f /etc/release ];
 then
   system=solaris
@@ -1941,6 +1965,7 @@
     "fedora"             ) ;;
     "debian"             ) ;;
     "solaris"             ) ;;
+    "gentoo"             ) ;;
     ""                 ) 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'" ;;
   esac
@@ -2094,18 +2119,7 @@
   result=$?
   if [ "$result" = 0 ];
   then
-    txt=`/bin/bash -c "su - nx < /dev/null 2>&1 | /bin/grep -c 'NXSERVER'" 2>&1`
-    if [ "$?" != 0 ];
-    then
-      if [ "$txt" = "0" ];
-      then
-        echo "$PREFIX $ERROR ERROR: User 'nx' already exist but is not used by nxserver."
-        echo "$PREFIX $ERROR ERROR: Delete user 'nx' and run $NODE_ROOT/bin/nxsetup --install"
-        exit 1
-      else
-        echo "$PREFIX $ERROR ERROR: Error when checking if user nx is used by nx server: '$txt'"
-      fi
-    elif [ -f "$NODE_ROOT/etc/node.conf" -o  -f "$NODE_ROOT/etc/node.cfg" ];
+    if [ -f "$NODE_ROOT/etc/node.conf" -o  -f "$NODE_ROOT/etc/node.cfg" ];
     then
       procedureUpdate
       return 0