cd /software/
934 ls
935 cd torque/
936 ls
937 cd 4.1.2/
938 ls
939 ./torque-package-mom-linux-x86_64.sh --help
940 ./torque-package-mom-linux-x86_64.sh --listfiles
941 ls
942 ./torque-package-clients-linux-x86_64.sh --listfiles
943 ./torque-package-clients-linux-x86_64.sh --install
944 clear
945 qsub
946 exit
947 df -h
948 cd /software/
949 ls
950 cd torque/
951 la
952 ls
953 cd 4.1.2/
954 ls
955 ls -ltr
956 pwd
957 cd /software/toolss
958 cd /software/tools
959 ls
960 cd ..
961 ls
962 cd torque/
963 ls
964 cd 4.1.2/
965 ls
966 ls -ltr
967 sh ./torque-package-clients-linux-x86_64.sh
968 sh ./torque-package-clients-linux-x86_64.sh --install --verbose
969 ls
970 cd ..
971 ls
972 cd ..
973 ls
974 pwd
975 cd src/
976 ls
977 cd torque-4.1.2
978 ls
979 cd con
980 ls
981 cd contrib/
982 ls
983 cd init.d
984 ls
985 ls -l /etc/init.d|grep trq
986 cp -a trqauthd /etc/init.d/
987 cd /etc/init.d
988 ls -ltr
989 getent passwd
990 ls
991 service trqauthd start
992 qstat
993 pbsnodes -l
994 chkconfig --add trqauthd
995 chkconfig trqauthd
996 chkconfig --list|grep trqauthd
999 vim /etc/hosts
//modify the torquemaster, and add new host to the manager by "qmgr -c"
Thursday, November 29, 2012
Tuesday, November 20, 2012
specified unpartitioned disk sda in partition command
When getting this error message in a kickstart;
The inforamation can be stored in different locations on the harddrive, to my knowledge its commonly in the end though. If you dont want to consider this further, you can delete the entire disk by running;
specified unpartitioned disk sda in partition commandIts possibly due to dmraid information still present on the disk from an earlier installation. Verify by running (press F2 after kickstart halts):
$ dmraid -r -D /dev/sdaYou should get information about the disk being member of a raidset.
The inforamation can be stored in different locations on the harddrive, to my knowledge its commonly in the end though. If you dont want to consider this further, you can delete the entire disk by running;
$ dd if=/dev/zero of=/dev/sdaIt will take some time as the entire disk is being written to. If you want to make a more surgical approach, just erase the last couple of sectors. First run fdisk;
$ fdisk -lThen run the following command. Adapt the values for ”bs” and ”seek” to suit your actual harddrive. You get the values from the fdisk output above. In the below example, i’m deleting the last 10 sectors of the disk (91201 – 10 = 91191):
Disk /dev/sda: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 byte
dd if=/dev/zero of=/dev/sda bs=8225280 seek=91191 count=1Verify that the dmraid information is actually gone;
dmraid -r -D /dev/sdaThe output should now be different from before, saying the disk is not a member. If so, you should be able to use it to kickstart on.
specified unpartitioned disk sda in partition command
When getting this error message in a kickstart;
The inforamation can be stored in different locations on the harddrive, to my knowledge its commonly in the end though. If you dont want to consider this further, you can delete the entire disk by running;
specified unpartitioned disk sda in partition commandIts possibly due to dmraid information still present on the disk from an earlier installation. Verify by running (press F2 after kickstart halts):
$ dmraid -r -D /dev/sdaYou should get information about the disk being member of a raidset.
The inforamation can be stored in different locations on the harddrive, to my knowledge its commonly in the end though. If you dont want to consider this further, you can delete the entire disk by running;
$ dd if=/dev/zero of=/dev/sdaIt will take some time as the entire disk is being written to. If you want to make a more surgical approach, just erase the last couple of sectors. First run fdisk;
$ fdisk -lThen run the following command. Adapt the values for ”bs” and ”seek” to suit your actual harddrive. You get the values from the fdisk output above. In the below example, i’m deleting the last 10 sectors of the disk (91201 – 10 = 91191):
Disk /dev/sda: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 byte
dd if=/dev/zero of=/dev/sda bs=8225280 seek=91191 count=1Verify that the dmraid information is actually gone;
dmraid -r -D /dev/sdaThe output should now be different from before, saying the disk is not a member. If so, you should be able to use it to kickstart on.
Tuesday, October 30, 2012
Predefined Macros
There are predefined macros that are used by most compilers, you can find the list [here]. GCC compiler predefined macros can be found [here].
http://sourceforge.net/p/predef/wiki/OperatingSystems/
http://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html
http://sourceforge.net/p/predef/wiki/OperatingSystems/
http://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html
#ifdef _WIN64
//define something for Windows (64-bit)
#elif _WIN32
//define something for Windows (32-bit)
#elif __APPLE__
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE
// iOS device
#elif TARGET_IPHONE_SIMULATOR
// iOS Simulator
#elif TARGET_OS_MAC
// Other kinds of Mac OS
#else
// Unsupported platform
#endif
#elif __linux
// linux
#elif __unix // all unices not caught above
// Unix
#elif __posix
// POSIX
#endif
Thursday, October 11, 2012
centos 6.3 enter single user mode and fix lvm partiton
1) enter grub.
2) add "single" as kernel paramters
3) boot into single user mode.
4) if file system is read-only, do:
mount -o remount,rw /
5) recreate the volume group:
vgcreate new_vol_name /dev/sd*
6) create logical volume and use full volume groupt
lvcreate -l 100%FREE -n new_lv_name your_vg_name
7)format the logical volume
a, http://blog.tsunanet.net/2011/08/mkfsxfs-raid10-optimal-performance.html
b,http://wikihelp.autodesk.com/Creative_Finishing/enu/2012/Help/05_Installation_Guides/Installation_and_Configuration_Guide_for_Linux_Workstations/0118-Advanced118/0194-Manually194/0199-Creating199
//comment: use the second (autodesk one) method is fast and stable.
remeber, if your disk has BBU setup. you need to disable barrier.
just do it while mount the xfs partion with "-o nobarrier". please google centos documents.
reference:
1) http://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/LV_create.html
2:
2) add "single" as kernel paramters
3) boot into single user mode.
4) if file system is read-only, do:
mount -o remount,rw /
5) recreate the volume group:
vgcreate new_vol_name /dev/sd*
6) create logical volume and use full volume groupt
lvcreate -l 100%FREE -n new_lv_name your_vg_name
7)format the logical volume
a, http://blog.tsunanet.net/2011/08/mkfsxfs-raid10-optimal-performance.html
b,http://wikihelp.autodesk.com/Creative_Finishing/enu/2012/Help/05_Installation_Guides/Installation_and_Configuration_Guide_for_Linux_Workstations/0118-Advanced118/0194-Manually194/0199-Creating199
//comment: use the second (autodesk one) method is fast and stable.
remeber, if your disk has BBU setup. you need to disable barrier.
just do it while mount the xfs partion with "-o nobarrier". please google centos documents.
reference:
1) http://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/LV_create.html
2:
Root your box, and mount LVM partitions
I was teaching a friend how to root a box by adding:
Posted by
Shannon Eric Peevey
at
1:53 PM
init=/bin/bashto the kernel line in grub, and then wanted to show him how to install some apps from the command line. I had never done this with LVM partitions, and was surprised when I got the following error:
File based locking initialization failedDoh! I forgot to remount root read/write:
mount -o remount,rw /Finally, I was able to mount all my LVM partitions with:
lvm vgscanhaha! I'm getting rusty :P
lvm vgchange -ay
lvm lvs
mount -a
Thursday, September 6, 2012
centos kickstarts configure file example
Linux Documentation Sucks
Every time I try to lookup how to do something in Linux, I get a deluge of out of date, incomplete, and just plain wrong documentation. This is the PXE/Kickstart guide I wish I would have read before I wasted 3 days. Thanks for nothing, RedHat documentation team.Outline of the steps
* Obtain installation media* Create Kickstart config file
* Setup NFS server
* Obtain PXE bootloader
* Create PXE config file
* Setup TFTP server
* Setup DHCP server
Installation Media
I was installing CentOS 5.5/x86_64 during this process, so I downloaded the two DVD images via torrent onto my NFS server. My BitTorrent client created the directory CentOS-5.5-x86_64-bin-DVD with the files:CentOS-5.5-x86_64-bin-DVD-1of2.iso md5sum.txt sha1sum.txt sha256sum.txt CentOS-5.5-x86_64-bin-DVD-2of2.iso md5sum.txt.asc sha1sum.txt.asc sha256sum.txt.ascI moved this directory to /share/images to make it available via NFS.
Next I mounted the first ISO file as a loop image and copied the initrd and kernel to my DHCP server:
$ sudo mount /share/images/CentOS-5.5-x86_64-bin-DVD/CentOS-5.5-x86_64-bin-DVD-1of2.iso /mnt/dvd/ -t iso9660 -o loop $ scp /mnt/dvd/images/pxeboot/*i* root@dhcp-server:/tftpboot
Kickstart File
I created the directory /share/kickstart for Kickstart config files on my NFS server.I created the Kickstart file (test64-ks) using a previous CentOS install as a basis, and editing it based on snippets I found scattered around the 'Web.
# Kickstart file automatically generated by anaconda. # Modified substantially by chort install nfs --server 10.25.0.129 --dir /share/images/CentOS-5.5-x86_64-bin-DVD/ #url --url http://mirror.centos.org/centos/5.4/os/x86_64 lang en_US.UTF-8 keyboard us # don't define more NICs than you have, the install will bomb if you do network --device eth0 --onboot yes --bootproto static --ip 10.25.42.139 --netmask 255.255.0.0 --gateway 10.25.0.1 --nameserver 10.25.0.5 #network --device eth1 --onboot no --bootproto dhcp #network --device eth2 --onboot no --bootproto dhcp #network --device eth3 --onboot no --bootproto dhcp # grab the hash from an account in /etc/shadow that has the password you want to use rootpw --iscrypted $1$fi0JeZ1p$Il0CxFxe0jqpNnkrOqC.0. firewall --enabled --port=22:tcp authconfig --enableshadow --enablemd5 selinux --disabled timezone --utc America/Los_Angeles bootloader --location=mbr --driveorder=sda # The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work clearpart --all --drives=sda # 100MB /boot partition part /boot --fstype ext3 --size=100 --ondisk=sda # everything else goes to LVM part pv.4 --size=0 --grow --ondisk=sda volgroup VolGroup00 --pesize=32768 pv.4 # 2GB swap fs logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=2048 # 5GB / fs logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=5120 # 10GB + remaining space for /opt fs logvol /opt --fstype ext3 --name=LogVol02 --vgname=VolGroup00 --size=10240 --grow %packages @base @core @dialup @editors @text-internet keyutils trousers fipscheck device-mapper-multipath bind bind-chroot bind-devel caching-nameserver compat-libstdc++-33 compat-glibc gdb ltrace ntp OpenIPMI-tools screen sendmail-cf strace sysstat -bluez-utils %post /usr/bin/yum -y update >> /root/post_install.log 2>&1 /sbin/chkconfig --del bluetooth /sbin/chkconfig --del cups /sbin/chkconfig ntpd on /sbin/chkconfig named on
NFS Server
Make sure NFS is enabled:$ for i in nfs nfslock portmap ; do sudo chkconfig --list $i ; done
Edit /etc/exports to enable access to the share for the machines that will PXE boot:
# sample /etc/exports file #/ master(rw) trusty(rw,no_root_squash) #/projects proj*.local.domain(rw) #/usr *.local.domain(ro) @trusted(rw) #/home/joe pc001(rw,all_squash,anonuid=150,anongid=100) #/pub (ro,insecure,all_squash) #/pub (ro,insecure,all_squash) /share *.bkeefer.se.example.com(ro,no_root_squash)
I restart the nfs service after I edit /etc/exports
$ sudo service nfs restart
Bootloader
Next, on the DHCP server, I grabbed the PXE bootloader from the syslinux package. You should be able to install this through yum:$ sudo yum install syslinux
Copy the bootloader to the TFTP server directory:
$ sudo cp /usr/lib/syslinux/pxelinux.0 /tftpboot
Create the pxelinux.cfg directory in /tftpboot and edit the default file:
# You can have multiple kernels, if so name each with it's version # This configuration only has one possible kernel so I didn't rename it default linux label linux kernel vmlinuz append ksdevice=eth0 load_ramdisk=1 initrd=initrd.img network ks=nfs:10.25.0.129:/share/kickstart/test64-ks
TFTP Server
Configure the TFTP server by editing /etc/xinetd.conf/tftp file:# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -vvs /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
I changed "disable = yes" -> "disable = no" and "server_args = -s
/tftpboot" -> "server_args = -vvs /tftpboot". xinetd probably
doesn't need to be restarted, but I did any way:$ sudo service xinetd restart
I had only a single machine to boot, so I used a fixed IP base on the Ethernet address. Make sure you edit /var/lib/dhcp.lease* to erase references to the MAC and restart dhcpd. Here's the /etc/dhcpd.conf
shared-network SE-NET {
subnet 10.25.42.0 netmask 255.255.255.0 {
authoritative;
allow booting;
option routers 10.25.0.1;
option subnet-mask 255.255.0.0;
option domain-name "bkeefer.se.example.com";
option domain-name-servers 10.25.0.5;
option time-offset -28800;
option ntp-servers ntp.example.com;
host test64 {
hardware ethernet 00:0c:29:b3:81:99;
fixed-address 10.25.42.139;
next-server 10.25.0.5;
filename "pxelinux.0";
}
}
}
I haven't had any luck with restarting dhcpd, so I do stop followed by start:
$ sudo service dhcpd stop && sudo service dhcpd start
Note that there are also forward and reverse DNS entries to match 10.25.42.139 to test64.bkeefer.se.example.com .
Final Step
At this point you should be able to edit the BIOS for the machine you're booting to make sure the network card is in the boot order (as long as there's no OS installed, it should boot off the NIC no matter where it is in the order).Conclusion
There, was that so hard? You'd think with the hundreds of millions of dollars RedHat takes in every year they could afford to test their documentation, and maybe even write start-to-finish guides instead of disconnected snippets.Please e-mail me at
This site © copyright 2003-2010 Brian Keefer. Opinions expressed on this site are my own and do not reflect those of my employer.
Wednesday, August 8, 2012
Perl CPAN install at user directory
If you're mostly familiar with this document, and just want the incants, skip to the cheat sheet.
CPAN is the "Comprehensive Perl Archive Network", a repository of useful Perl modules. Most projects written in Perl depend on at least one module from CPAN, and dependency graphs of dozens of modules are not uncommon. Unfortunately, installing CPAN modules can be somewhat tricky, in part due to the age of many of the tools involved. This document is designed to help someone who is not a Perl programmer learn how to get a CPAN module or set of modules installed with a minimum of pain.
If you are running Debian or Ubuntu, the Perl module
For more details, such as how to manage multiple different
CPAN is the "Comprehensive Perl Archive Network", a repository of useful Perl modules. Most projects written in Perl depend on at least one module from CPAN, and dependency graphs of dozens of modules are not uncommon. Unfortunately, installing CPAN modules can be somewhat tricky, in part due to the age of many of the tools involved. This document is designed to help someone who is not a Perl programmer learn how to get a CPAN module or set of modules installed with a minimum of pain.
Is it in my distribution?
Most popular Linux distributions package a large number of CPAN modules as part of the distribution. If a sufficiently new version of the package you want is available from your distribution, this is likely to be a better option than installing it from CPAN.If you are running Debian or Ubuntu, the Perl module
Foo::Bar will be present, if at all, under the name libfoo-bar-perl. On Fedora, it will be named perl-Foo-Bar, or can be found with the queryyum whatprovides 'perl(Foo::Bar)'
Installing packages system-wide
The easiest way to use CPAN is to install packages system-wide. Runcpan as your user, and then enter the following commands to configure CPAN to use sudo to get root privileges to install packages:o conf make_install_make_command '/usr/bin/sudo /usr/bin/make'
o conf mbuild_install_build_command '/usr/bin/sudo ./Build'
o conf commit
You should now be able to install a package with install Package.Installing packages locally
If you don't have root access, just want to install packages for your own use, or want to install packages into AFS for use from multiple systems, you wantlocal::lib. (It's possible to configure CPAN to do this by hand, but trust me, local::lib is easier).- Grab the latest
local::libtarball from CPAN (As of this writing, that's version 1.008004) - Unpack the tarball and run
perl Makefile.PL --bootstrap=/path/to/install/ make && make install
perl -I/path/to/install/lib/perl5/ -Mlocal::lib
to get a fragment of shell code you should run to set up your
environment to both use perl modules from your install, and to tell cpan to install there.For more details, such as how to manage multiple different
local::lib installations, see local::lib's documentation on CPANAutomatically installing dependencies
By default, CPAN prompts you whether or not to follow dependencies when installing a package. This is not usually what you want -- if you want a specific package, you don't care what CPAN has to install to get it to you, so it should do so automatically. There are two steps required to get CPAN to do this:- Within the CPAN interactive shell (run
cpan), Setprerequisites_policytofollow(o conf prerequisites_policy followand theno conf commit) - Set the environment variable
PERL_MM_USE_DEFAULTto1. e.g. runcpanas
env PERL_MM_USE_DEFAULT=1 cpan
Gotchas using CPAN on Athena
- For whatever reason, perl believes itself to be smarter than your
operating system by default, and checks permissions by looking at the
permission bits on files, rather than using
access(2). (See filetest in the Perl docs.) Furthermore, when installing modules, CPAN checks to see if you have write permissions on the destination, and aborts if it doesn't think you do, without even trying. I have been unable to find a way to override either of these behaviors.
This is a problem in AFS for obvious reasons, since AFS does not use UNIX permissions. I happen to only need to install perl modules into lockers on which I am the owner; If you need to install things somewhere where the UNIX permission bits indicate you would not have access, you're out of luck as far as I can tell. - Sharing a
local::libinstallation dir across multiple platforms is not recommended. While perl does include the architecture and sysname (e.g.x86_64-linux-gnu-thread-multi/) in the path when installing.sofiles for modules written in XS, it does not do the same for the version of Perl itself. So while you can share a single installation directory between 32- and 64-bit platforms, or between Linux and Solaris, all kinds of things will go wrong if you try to share it between a 32-bit perl 5.8 and a 32-bit perl 5.10 on the same platform.
Cheat-sheet
Installing packages system-wide
$ env PERL_MM_USE_DEFAULT=1 cpan
# Answer 'yes' if CPAN asks to configure itself automatically
cpan> o conf make_install_make_command '/usr/bin/sudo /usr/bin/make'
cpan> o conf mbuild_install_build_command '/usr/bin/sudo ./Build'
cpan> o conf prerequisites_policy follow
cpan> o conf commit
cpan> install Some::Module
Installing packages into a directory
$ wget http://www.cpan.org/modules/by-module/lib/local-lib-1.008004.tar.gz
$ tar xzf local-lib-1.008004.tar.gz
$ cd local-lib-1.008004/
$ perl Makefile.PL --bootstrap=/install/dir/
$ make && make install
$ eval $(perl -I/install/dir/lib/perl5/ -Mlocal::lib)
$ env PERL_MM_USE_DEFAULT=1 cpan
# Answer 'yes' if CPAN asks to configure itself automatically
cpan> o conf prerequisites_policy follow
cpan> o conf commit
cpan> install Some::Module
Subscribe to:
Posts (Atom)