solaris

How do I translate init.d scripts from Ubuntu/Debian Linux to Solaris?

I have several init.d scripts that I'm using to start some daemons. Most of these scripts I've found on the internet and they all use start-stop-daemon. My understanding is that "start-stop-daemon" is a command that is specific to Linux or BSD distros and is not available on Solaris. What is the best way to translate my init.d scripts f...

How do you use newgrp in a script then stay in that group when the script exits.

I am running a script on a solaris Box. specifically SunOS 5.7. I am not root. I am trying to execute a script similar to the following: newgrp thegroup << FOO source .login_stuff echo "hello world" FOO The Script runs. The problem is it returns back to the calling process which puts me in the old group wit...

Files being used by a unix process

The fuser command lets me know which processes are using a file or directory. I'm looking for command that does the opposite: lets me know which files are being used by a process. Update Forgot to mention that it's for a Solaris system. ...

How can I kill a whole process tree with Perl?

What's the best way to kill a process and all its child processes from a Perl script? It should run at least under Linux and Solaris, and not require installation of any additional packages. My guess would be to get a list of all processes and their parents by parsing files in /proc or by parsing the output of ps (neither of which seems...

solaris filemerge and pstack equivalents for linux

Accepting the possibility of extreme ridicule, I must admit that I really miss sun Teamware's filemerge tool. I have switched from solaris to red hat linux, and find myself regularly missing filemerge (not to be confused with the Apple tool of the same name), as well as the solaris version of pstack (which worked on core files just as we...

tb_event_death when single stepping in dbx

When I am single stepping through one thread of a multi threaded program, the debugger gets interrupted with: 0x(some hex ref) : tdb_event_death : ret dbx: thread has exited -- next aborted My guess is a thread somewhere in the program I am debugging has stopped, but it's not the one I'm debugging so I can't see why I have to res...

What's the Solaris equivalent to the BSD's 'tail -n100'?

I've looked this up a thousand times, and I always forget it, so, here for eternity: Solaris has a bit of an awkward syntax for tail. How do I do the equivalent of BSD's tail -nN? What I want are the last N lines from tail's input. ...

Python 2.5.2 and Solaris 8 (gcc 3.4.2) build issues

Hello there, I'm trying to build python 2.5.2 on Solaris 8 using gcc 3.4.2. I can't see any immediate errors in the ./configure step but, once built and i enter the python shell doing an import time errors with : Python 2.5.2 (r252:60911, Nov 21 2008, 18:45:42) [GCC 3.4.2] on sunos5 Type "help", "copyright", "credits" or "license" for...

smb.conf file location on different flavors of Solaris

Ok I am a total beginner with the Solaris Operating system and I need to install and configure samba on 3 boxes each has a different version of Solaris (8,9,10). What i want to know is where the smb.conf files go in each version. So far all I have found is Solaris 8 - /usr/local/samba/lib/smb.conf Solaris 9 - Solaris 10 - ...

Comprehensive methods of viewing memory usage on Solaris

On Linux, the "top" command shows a detailed but high level overview of your memory usage, showing: Total Memory, Used Memory, Free Memory, Buffer Usage, Cache Usage, Swap size and Swap Usage. My question is, what commands are available to show these memory usage figures in a clear and simple way? Bonus points if they're present in the...

How do you get nano/pico running on OpenSolaris?

We're setting up an OpenSolaris server on Amazon's EC2 service. However, vi/vim doesn't work properly, and pkg doesn't have nano/pico. Is there any other text-editor maybe? ...

GCC/ELF - from where comes my symbol ?

There is an executable that is dynamically linked to number of shared objects. How can I determine, to which of them some symbol (imported into executable) belongs ? If there are more than one possibility, could I silmulate ld and see from where it is being taken ? ...

Hide symbol(s) in Shared Object from LD

I have two third-party libraries occasionally having the same symbol name exported. When the executable is loaded, ld usually picks the wrong one and I getting crash as a result. I cannot do too much about the content of these libraries, so may be there is a way to instruct ld how to find the proper imlementation ? OS - Solaris 10, my p...

Meaning of SIZE and RSS values in prstat output

Can somebody give some clear explanation of the meaning of the SIZE and RSS values we get from prstat in Solaris? I wrote a testing C++ application that allocates memory with new[], fills it and frees it with delete[]. As I understood, the SIZE value should be related to how much virtual memory has been "reserved" by the process, that ...

How do you put a breakpoint on a memory location in dbx?

A co-worker has a C program that fails in a predictable manner because of some corrupted memory. He'd like to use dbx to monitor the memory location once it's allocated in order to pinpoint the code that causes the corruption. Is this possible? If so what is the syntax to produce a breakpoint at the moment of corruption? If not, what...

Disable character echo on Java network connection

I have a Solaris daemon written in Java6. Clients can connect to it using a telnet style interface. They telnet to a particular port, and I read lines of input and act on them. At one point in I need to prompt the user to enter a password, and while they're entering that I want to disable the echoing of characters back to the telnet cli...

What is the state of a TCP socket after remote closed?

Hello, Say I have accepted() a connection to my server (that runs on a Solaris) and the client has closed the connection. What is the state of the socket (in netstat categories) of the socket on the server side before I close() it on the server side? Is it BOUND? ...

Porting Application from Solaris to Linux

Hi, I am to take up the task of porting a C++ networking application code base of quite a size from Solaris to Linux platform. The code also uses third party libraries like ACE. The application when written initially was not planned for a possible porting in future. I would like to get some advice and suggestions as to how I go about ...

Successful install of SJSAS 8.2EE Patch 2 on Solaris 10 x86?

"no asnss in java.library.path" This is what I get when trying create-domain on Sun Java System Application Server Enterprise Edition 8.2 (build b30-p02) Solaris 10 Generic_137138-09 i86pc i386 i86pc. I have also tried SJSAS 8.2EE Patch 6 and got the same error. Nothing seem out of place in the install log. Please advise... ...

Code injection - Solaris & Linux

I have an executable module created by third party. I would like to "inject" my code (kind of watchdog running in separate thread) into this process. So far there are two possible ways - one is to run my code as executable and dynamically load a proess on top of it (seems to be very hard and tricky) or to make my code a shared object, ...