diff --git a/makeclientrpm b/makeclientrpm index 1d57461d6..451bf48b2 100755 --- a/makeclientrpm +++ b/makeclientrpm @@ -5,11 +5,11 @@ OSNAME=$(uname) if [ "$OSNAME" = "AIX" ] then - tar -cvf xCAT-client-2.0.tar xCAT-client-2.0 - gzip xCAT-client-2.0.tar - cp xCAT-client-2.0.tar.gz /opt/freeware/src/packages/SOURCES + echo '.svn' > /tmp/xcat-excludes + tar -X /tmp/xcat-excludes -cvf /opt/freeware/src/packages/SOURCES/xCAT-client-2.0.tar xCAT-client-2.0 + gzip /opt/freeware/src/packages/SOURCES/xCAT-client-2.0.tar cd ./xCAT-client-2.0 - rm /opt/freeware/src/packages/RPMS/ppc/xCAT-client-2.0*rpm + rm -f /opt/freeware/src/packages/SRPMS/xCAT-client-2.0*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-client-2.0*rpm rpm -ba xCAT-client.spec #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-client-2.0*rpm @@ -22,8 +22,8 @@ else pkg="packages" fi - tar --exclude .svn -czvf xCAT-client-2.0.tar.gz xCAT-client-2.0; - rm /usr/src/$pkg/RPMS/noarch/xCAT-client-2.0*rpm - rpmbuild -ta xCAT-client-2.0.tar.gz ; + tar --exclude .svn -czvf /usr/src/$pkg/SOURCES/xCAT-client-2.0.tar.gz xCAT-client-2.0; + rm -f /usr/src/$pkg/SRPMS/xCAT-client-2.0*rpm /usr/src/$pkg/RPMS/noarch/xCAT-client-2.0*rpm + rpmbuild -ta /usr/src/$pkg/SOURCES/xCAT-client-2.0.tar.gz ; #rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-client-2.0*rpm fi diff --git a/makeperlxcatrpm b/makeperlxcatrpm index 4b106140a..4002a30a3 100755 --- a/makeperlxcatrpm +++ b/makeperlxcatrpm @@ -4,12 +4,12 @@ OSNAME=$(uname) if [ "$OSNAME" = "AIX" ] then - - tar -cvf perl-xCAT-2.0.tar perl-xCAT-2.0 - gzip perl-xCAT-2.0.tar - cp perl-xCAT-2.0.tar.gz /opt/freeware/src/packages/SOURCES + + echo '.svn' > /tmp/xcat-excludes + tar -X /tmp/xcat-excludes -cvf /opt/freeware/src/packages/SOURCES/perl-xCAT-2.0.tar perl-xCAT-2.0 + gzip /opt/freeware/src/packages/SOURCES/perl-xCAT-2.0.tar cd ./perl-xCAT-2.0 - rm /opt/freeware/src/packages/RPMS/ppc/perl-xCAT-2.0*rpm + rm -f /opt/freeware/src/packages/SRPMS/perl-xCAT-2.0*rpm /opt/freeware/src/packages/RPMS/ppc/perl-xCAT-2.0*rpm rpm -ba perl-xCAT.spec #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/perl-xCAT-2.0*rpm @@ -21,8 +21,8 @@ else pkg="packages" fi - tar --exclude .svn -czvf perl-xCAT-2.0.tar.gz perl-xCAT-2.0/; - rm /usr/src/$pkg/RPMS/noarch/perl-xCAT-2.0*rpm - rpmbuild -ta perl-xCAT-2.0.tar.gz ; + tar --exclude .svn -czvf /usr/src/$pkg/SOURCES/perl-xCAT-2.0.tar.gz perl-xCAT-2.0/; + rm -f /usr/src/$pkg/SRPMS/perl-xCAT-2.0*rpm /usr/src/$pkg/RPMS/noarch/perl-xCAT-2.0*rpm + rpmbuild -ta /usr/src/$pkg/SOURCES/perl-xCAT-2.0.tar.gz ; #rpm -Uvh /usr/src/$pkg/RPMS/noarch/perl-xCAT-2.0*rpm fi diff --git a/makeserverrpm b/makeserverrpm index 9cff079cf..ff4d023fc 100755 --- a/makeserverrpm +++ b/makeserverrpm @@ -4,13 +4,14 @@ OSNAME=$(uname) if [ "$OSNAME" = "AIX" ] then - tar -cvf xCAT-server-2.0.tar xCAT-server-2.0 - gzip xCAT-server-2.0.tar - cp xCAT-server-2.0.tar.gz /opt/freeware/src/packages/SOURCES - cd ./xCAT-server-2.0 - rm /opt/freeware/src/packages/RPMS/ppc/xCAT-server-2.0*rpm - rpm -ba xCAT-server.spec - #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-server-2.0*rpm + + echo '.svn' > /tmp/xcat-excludes + tar -X /tmp/xcat-excludes -cvf /opt/freeware/src/packages/SOURCES/xCAT-server-2.0.tar xCAT-server-2.0 + gzip /opt/freeware/src/packages/SOURCES/xCAT-server-2.0.tar + cd ./xCAT-server-2.0 + rm -f /opt/freeware/src/packages/SRPMS/xCAT-server-2.0*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-server-2.0*rpm + rpm -ba xCAT-server.spec + #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-server-2.0*rpm else @@ -21,8 +22,8 @@ else pkg="packages" fi - tar --exclude .svn -czvf xCAT-server-2.0.tar.gz xCAT-server-2.0; - rm /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm - rpmbuild -ta xCAT-server-2.0.tar.gz ; + tar --exclude .svn -czvf /usr/src/$pkg/SOURCES/xCAT-server-2.0.tar.gz xCAT-server-2.0; + rm -f /usr/src/$pkg/SRPMS/xCAT-server-2.0*rpm /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm + rpmbuild -ta /usr/src/$pkg/SOURCES/xCAT-server-2.0.tar.gz ; #rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm fi diff --git a/makewebrpm b/makewebrpm new file mode 100644 index 000000000..73a77945f --- /dev/null +++ b/makewebrpm @@ -0,0 +1,34 @@ +#!/bin/ksh + +OSNAME=$(uname) +version='2.0' + +if [ "$OSNAME" = "AIX" ] +then + echo '.svn' > /tmp/xcat-excludes + tar -X /tmp/xcat-excludes -cvf /opt/freeware/src/packages/SOURCES/xCAT-web.tar xCAT-web + gzip /opt/freeware/src/packages/SOURCES/xCAT-web.tar + cd ./xCAT-web + rm -f /opt/freeware/src/packages/SRPMS/xCAT-web*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-web*rpm + rpm -ba xCAT-web.spec + #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-web*rpm + +else + if [ -f /etc/redhat-release ] + then + pkg="redhat" + else + pkg="packages" + fi + source=$PWD + + # Trying to avoid having the version # (2.0) on the xCAT-web dir name in svn + set -x + cd /usr/src/$pkg/SOURCES + rm -f xCAT-web-$version; ln -s $source/xCAT-web xCAT-web-$version # have to make tar think it is in xCAT-web-2.0 + rm -f xCAT-web-$version.tar.gz + tar -czhf xCAT-web-$version.tar.gz --exclude=.svn --exclude=.project xCAT-web-$version + rm -f /usr/src/$pkg/SRPMS/xCAT-web-$version*rpm /usr/src/$pkg/RPMS/noarch/xCAT-web-$version*rpm + rpmbuild -ta xCAT-web-$version.tar.gz + #rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-web-$version*rpm +fi diff --git a/xCAT-web/manage/dsh.php b/xCAT-web/manage/dsh.php index 51171a1c3..41e9704da 100644 --- a/xCAT-web/manage/dsh.php +++ b/xCAT-web/manage/dsh.php @@ -71,55 +71,55 @@ if (!isset($_REQUEST['noderange'])) { to /tmp on the nodes and executed from there.) - - Use parallel shell (psh) command instead of xdsh. + + Use parallel shell (psh) command instead of xdsh. Currently this option must be used, and the options below (associated with xdsh) are disabled. Options: - Streaming mode + Streaming mode Specifies that output is returned as it becomes available from each target, instead of waiting for the command to be completed on a target before returning output from that target. - Monitor + Monitor Prints starting and completion messages for each node. Useful with Streaming mode. - Verify + Verify Verifies that nodes are responding before sending the command to them. - Collaspe Identical Output + Collaspe Identical Output Automatically pipe the xdsh output into xdshbak which will only display output once for all the nodes that display identical output. See the xdshbak man page for more info. - Fanout: + Fanout: The maximum number of nodes the command should be run on concurrently. When the command finishes on 1 of the nodes, it will be started on an additional node (the default is 64). - UserID: + UserID: The user id to use to run the command on the nodes. - Remote Shell: + Remote Shell: The remote shell program to use to run the command on the nodes. The default is /usr/bin/ssh. - Shell Options: + Shell Options: Options to pass to the remote shell being used. - Code Return + Return Code Prints the return code of the (last) command that was run remotely on each node. The return code is appended at the end of the output for each node. diff --git a/xCAT-web/manage/dsh_action.php b/xCAT-web/manage/dsh_action.php index 59bc27266..58ab62e52 100644 --- a/xCAT-web/manage/dsh_action.php +++ b/xCAT-web/manage/dsh_action.php @@ -51,12 +51,12 @@ if (isset($_COOKIE['history']) && array_search($_REQUEST['command'], $_COOKIE['h if ($psh == "off"){ //using dsh $command = "xdsh "; $copy_cmd = "xdcp "; - if ($group == "") $node_group = "-n " . $node; - else $node_group = "-N " . $group; + if ($group == "") $node_group = /* "-n " . */ $node; + else $node_group = /* "-N " . */ $group; }else{ $command = "psh "; - $copy_cmd = "prcp "; + $copy_cmd = "pscp "; if ($group == "") $node_group = $node; else $node_group = $group; } diff --git a/xCAT-web/xCAT-web.spec b/xCAT-web/xCAT-web.spec index cad3aee1d..fe419d731 100644 --- a/xCAT-web/xCAT-web.spec +++ b/xCAT-web/xCAT-web.spec @@ -38,7 +38,7 @@ chmod 755 $RPM_BUILD_ROOT%{prefix}/web/* %files %defattr(-,root,root) # %defattr( 555, root, root, 755 ) -%{prefix} +%{prefix}/web %post @@ -50,26 +50,32 @@ then if [ -e "/etc/redhat-release" ]; then apachedaemon='httpd' apacheuser='apache' - else + + # todo: change this when switch to xcat 2 + echo "Updating apache userid to allow logins..." + cp /etc/passwd /etc/passwd.orig + perl -e 'while (<>) { s,^apache:(.*):/sbin/nologin$,apache:$1:/bin/bash,; print $_; }' /etc/passwd.orig >/etc/passwd + else # SuSE apachedaemon='apache2' apacheuser='wwwrun' fi # Update the apache config + echo "Updating $apachedaemon configuration for xCAT..." /bin/rm -f /etc/$apachedaemon/conf.d/xcat.conf - /bin/ln -s /opt/xcat/web/etc/apache2/conf.d/xcat.conf /etc/$apachedaemon/conf.d/xcat.conf + /bin/ln -s %{prefix}/web/etc/apache2/conf.d/xcat.conf /etc/$apachedaemon/conf.d/xcat.conf /etc/init.d/$apachedaemon reload - # Config sudo - todo: change this when switch to xcat 2 - if ! egrep "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers; then + # Link to the grpattr cmd. Todo: remove this when it is in base xcat + /bin/rm -f %{prefix}/bin/grpattr + mkdir -p %{prefix}/bin + /bin/ln -s %{prefix}/web/cmds/grpattr %{prefix}/bin/grpattr + + # Config sudo. Todo: change this when switch to xcat 2 + if ! egrep -q "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers; then + echo "Configuring sudo for $apacheuser..." echo "$apacheuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers fi - - #cp /etc/webmin/webmin.acl /etc/webmin/webmin.acl.orig - #perl -e 'while (<>) { if (/^root:/ && !/\bcsm\b/) {s/$/ csm/;} print $_; }' /etc/webmin/webmin.acl.orig >/etc/webmin/webmin.acl - #if [ `uname` = "Linux" ]; then - # kill -1 `cat /var/webmin/miniserv.pid` - #fi fi if [ "$1" = 1 ] || [ "$1" = 2 ] # initial install, or upgrade and this is the newer rpm @@ -82,11 +88,32 @@ fi if [ "$1" = 0 ] # final rpm being removed then - # Remove link to the apache conf file if [ -e "/etc/redhat-release" ]; then - /bin/rm -f /etc/httpd/conf.d/xcat.conf - else - /bin/rm -f /etc/apache2/conf.d/xcat.conf + apachedaemon='httpd' + apacheuser='apache' + + # Undo change we made to passwd file. Todo: change this when switch to xcat 2 + echo "Undoing apache userid login..." + cp /etc/passwd /etc/passwd.tmp + perl -e 'while (<>) { s,^apache:(.*):/bin/bash$,apache:$1:/sbin/nologin,; print $_; }' /etc/passwd.tmp >/etc/passwd + else # SuSE + apachedaemon='apache2' + apacheuser='wwwrun' fi + + # Remove links made during the post install script + echo "Undoing $apachedaemon configuration for xCAT..." + /bin/rm -f /etc/$apachedaemon/conf.d/xcat.conf + /etc/init.d/$apachedaemon reload + /bin/rm -f %{prefix}/bin/grpattr + + # Remove change we made to sudoers config. Todo: remove this when switch to xcat 2 + if egrep -q "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers; then + echo "Undoing sudo configuration for $apacheuser..." + cp -f /etc/sudoers /etc/sudoers.tmp + egrep -v "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers.tmp > /etc/sudoers + rm -f /etc/sudoers.tmp + fi + fi