Solaris Tips: Difference between revisions
No edit summary |
mNo edit summary |
||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== ksh: cvs: not found == | |||
Q: I'm trying to do a cvs command, but I get the error '''ksh: cvs: not found'''. | |||
A: The problem is ksh the remote shell, and it doesn't have cvs on it's path. You can specify the remote path by setting the following variable in your local environment: | |||
'''export CVS_SERVER=/opt/mystuff/cvs''' | |||
== httperf == | |||
Getting [[httpref]] to compile with ssl support on Solaris 10 x86 was a challenge. First I downloaded it of course, then I applied these settings to my environment: | |||
<geshi lang="bash"> | |||
export CPPFLAGS="-I/usr/local/ssl/include" | |||
export LDFLAGS="-L/usr/local/ssl/lib" | |||
./configure --prefix=/u/egge/ | |||
grep rpl_malloc * | |||
vi config.h | |||
# Remove #define malloc rpl_malloc | |||
make clean && make && make install | |||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/ssl/lib" | |||
$ ldd /u/egge/bin/httperf | |||
libresolv.so.2 => /lib/libresolv.so.2 | |||
libnsl.so.1 => /lib/libnsl.so.1 | |||
libsocket.so.1 => /lib/libsocket.so.1 | |||
libssl.so.0.9.8 => /usr/local/ssl/lib/libssl.so.0.9.8 | |||
libcrypto.so.0.9.8 => /usr/local/ssl/lib/libcrypto.so.0.9.8 | |||
libm.so.2 => /lib/libm.so.2 | |||
libc.so.1 => /lib/libc.so.1 | |||
libmp.so.2 => /lib/libmp.so.2 | |||
libmd5.so.1 => /lib/libmd5.so.1 | |||
libscf.so.1 => /lib/libscf.so.1 | |||
libdl.so.1 => /lib/libdl.so.1 | |||
libgcc_s.so.1 => /u/egge/lib/libgcc_s.so.1 | |||
libdoor.so.1 => /lib/libdoor.so.1 | |||
libuutil.so.1 => /lib/libuutil.so.1 | |||
</geshi> | |||
== tar == | |||
When I first compiled gnu's tar for Solaris, I had libiconv.so.2 dynamically linked. The problem with this is when I copied the tar binary to another machine I had to add libiconv.so.2 to LD_LIBRARY_PATH. | |||
<geshi lang="bash"> | |||
$ ldd /u/egge/bin/tar | |||
libiconv.so.2 => (file not found) | |||
librt.so.1 => /lib/librt.so.1 | |||
libc.so.1 => /lib/libc.so.1 | |||
libaio.so.1 => /lib/libaio.so.1 | |||
libmd5.so.1 => /lib/libmd5.so.1 | |||
libm.so.2 => /lib/libm.so.2 | |||
</geshi> | |||
I'm not sure if the LD_OPTIONS is needed, but in theory, this should allow the runtime linker to search a relative path. | |||
<geshi lang="bash"> | |||
$ export LD_OPTIONS='-R $ORIGIN/../lib' | |||
$ unset LD_LIBRARY_PATH | |||
$ ./configure --prefix=$HOME --exec-prefix=$HOME --with-static | |||
$ make && make install | |||
</geshi> | |||
Now tar is compiled without a dependency on libiconv.so.2. | |||
<geshi lang="bash"> | |||
$ ldd tar | |||
librt.so.1 => /lib/librt.so.1 | |||
libc.so.1 => /lib/libc.so.1 | |||
libaio.so.1 => /lib/libaio.so.1 | |||
libmd5.so.1 => /lib/libmd5.so.1 | |||
libm.so.2 => /lib/libm.so.2 | |||
</geshi> | |||
== rsync == | |||
I was getting an error when transferring some files | |||
<geshi lang="bash"> | |||
$ rsync -e ssh ... | |||
rsync: error writing 4 unbuffered bytes - exiting: Broken pipe | |||
rsync error: error in rsync protocol data stream (code 12) at io.c(464) | |||
$ rsync --version | |||
rsync version 2.5.4 protocol version 26 | |||
Copyright (C) 1996-2002 by Andrew Tridgell and others | |||
<http://rsync.samba.org/> | |||
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, no IPv6, | |||
64-bit system inums, 64-bit internal inums | |||
</geshi> | |||
I compiled a more recent rsync (2.6.9), and it fixed the issue. | |||
I have a user installed rsync, and a locked down ssh. In order to rsync files, I use this command. | |||
<geshi lang="bash"> | |||
rsync -e ssh --rsync-path=~/bin/rsync -avz --progress source dest | |||
</geshi> | |||
== [[vim Solaris 5.8]] == | |||
== source-highlight-2.7 == | |||
<geshi lang="bash"> | |||
# First I needed to compile boost. This was not so bad | |||
$ ./configure --prefix=$HOME --exec-prefix=$HOME --with-libraries=regex --enable-static=yes | |||
# The I had to figure out how to get source-highlight to compile | |||
$ ./configure --prefix=$HOME --exec-prefix=$HOME --enable-static=yes --enable-shared=yes CPPFLAGS=-I${HOME}/include/boost-1_34_1 \ | |||
--with-boost-regex=gcc41-1_34_1 | |||
</geshi> | |||
==Comma separate a list== | ==Comma separate a list== | ||
The challenge here is to avoid a trailing comma. | The challenge here is to avoid a trailing comma. | ||
< | <geshi lang="bash"> | ||
$ echo "foo\nbar\n" | awk ' {printf "%s%s",s,$0;s=","}END{print ""} ' | $ echo "foo\nbar\n" | awk ' {printf "%s%s",s,$0;s=","}END{print ""} ' | ||
foo,bar | foo,bar | ||
</ | </geshi> | ||
==Run a command on all hosts in a netgroup== | ==Run a command on all hosts in a netgroup== | ||
< | <geshi lang="bash"> | ||
mrsh -P -c 'uptime' your-netgroup | mrsh -P -c 'uptime' your-netgroup | ||
</ | </geshi> | ||
==Find all members in a sudoers group== | ==Find all members in a sudoers group== | ||
< | <geshi lang="bash"> | ||
ypmatch sqladmin group | ypmatch sqladmin group | ||
</ | </geshi> | ||
[[Category:Solaris|Tips]] |
Latest revision as of 03:25, 29 September 2008
ksh: cvs: not found
Q: I'm trying to do a cvs command, but I get the error ksh: cvs: not found.
A: The problem is ksh the remote shell, and it doesn't have cvs on it's path. You can specify the remote path by setting the following variable in your local environment: export CVS_SERVER=/opt/mystuff/cvs
httperf
Getting httpref to compile with ssl support on Solaris 10 x86 was a challenge. First I downloaded it of course, then I applied these settings to my environment:
<geshi lang="bash"> export CPPFLAGS="-I/usr/local/ssl/include" export LDFLAGS="-L/usr/local/ssl/lib" ./configure --prefix=/u/egge/ grep rpl_malloc * vi config.h
- Remove #define malloc rpl_malloc
make clean && make && make install export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/ssl/lib" $ ldd /u/egge/bin/httperf
libresolv.so.2 => /lib/libresolv.so.2 libnsl.so.1 => /lib/libnsl.so.1 libsocket.so.1 => /lib/libsocket.so.1 libssl.so.0.9.8 => /usr/local/ssl/lib/libssl.so.0.9.8 libcrypto.so.0.9.8 => /usr/local/ssl/lib/libcrypto.so.0.9.8 libm.so.2 => /lib/libm.so.2 libc.so.1 => /lib/libc.so.1 libmp.so.2 => /lib/libmp.so.2 libmd5.so.1 => /lib/libmd5.so.1 libscf.so.1 => /lib/libscf.so.1 libdl.so.1 => /lib/libdl.so.1 libgcc_s.so.1 => /u/egge/lib/libgcc_s.so.1 libdoor.so.1 => /lib/libdoor.so.1 libuutil.so.1 => /lib/libuutil.so.1
</geshi>
tar
When I first compiled gnu's tar for Solaris, I had libiconv.so.2 dynamically linked. The problem with this is when I copied the tar binary to another machine I had to add libiconv.so.2 to LD_LIBRARY_PATH.
<geshi lang="bash"> $ ldd /u/egge/bin/tar
libiconv.so.2 => (file not found) librt.so.1 => /lib/librt.so.1 libc.so.1 => /lib/libc.so.1 libaio.so.1 => /lib/libaio.so.1 libmd5.so.1 => /lib/libmd5.so.1 libm.so.2 => /lib/libm.so.2
</geshi>
I'm not sure if the LD_OPTIONS is needed, but in theory, this should allow the runtime linker to search a relative path. <geshi lang="bash"> $ export LD_OPTIONS='-R $ORIGIN/../lib' $ unset LD_LIBRARY_PATH $ ./configure --prefix=$HOME --exec-prefix=$HOME --with-static $ make && make install </geshi>
Now tar is compiled without a dependency on libiconv.so.2. <geshi lang="bash"> $ ldd tar
librt.so.1 => /lib/librt.so.1 libc.so.1 => /lib/libc.so.1 libaio.so.1 => /lib/libaio.so.1 libmd5.so.1 => /lib/libmd5.so.1 libm.so.2 => /lib/libm.so.2
</geshi>
rsync
I was getting an error when transferring some files <geshi lang="bash"> $ rsync -e ssh ... rsync: error writing 4 unbuffered bytes - exiting: Broken pipe rsync error: error in rsync protocol data stream (code 12) at io.c(464) $ rsync --version rsync version 2.5.4 protocol version 26 Copyright (C) 1996-2002 by Andrew Tridgell and others <http://rsync.samba.org/> Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, no IPv6,
64-bit system inums, 64-bit internal inums
</geshi>
I compiled a more recent rsync (2.6.9), and it fixed the issue.
I have a user installed rsync, and a locked down ssh. In order to rsync files, I use this command. <geshi lang="bash"> rsync -e ssh --rsync-path=~/bin/rsync -avz --progress source dest </geshi>
vim Solaris 5.8
source-highlight-2.7
<geshi lang="bash">
- First I needed to compile boost. This was not so bad
$ ./configure --prefix=$HOME --exec-prefix=$HOME --with-libraries=regex --enable-static=yes
- The I had to figure out how to get source-highlight to compile
$ ./configure --prefix=$HOME --exec-prefix=$HOME --enable-static=yes --enable-shared=yes CPPFLAGS=-I${HOME}/include/boost-1_34_1 \ --with-boost-regex=gcc41-1_34_1 </geshi>
Comma separate a list
The challenge here is to avoid a trailing comma. <geshi lang="bash"> $ echo "foo\nbar\n" | awk ' {printf "%s%s",s,$0;s=","}END{print ""} ' foo,bar </geshi>
Run a command on all hosts in a netgroup
<geshi lang="bash"> mrsh -P -c 'uptime' your-netgroup </geshi>
Find all members in a sudoers group
<geshi lang="bash"> ypmatch sqladmin group </geshi>