solaris

Getting around truncated “ps”

送分小仙女□ 提交于 2019-12-02 22:31:16
I'm trying to write a script that will find a particular process based on a keyword, extract the PID, then kill it using the found PID. The problem I'm having in Solaris is that, because the "ps" results are truncated, the search based on the keyword won't work because the keyword is part of the section (past 80 characters) that is truncated. I read that you can use "/usr/ucb/ps awwx" to get something more than 80 characters, but as of Solaris 10, this needs to be run from root, and I can't avoid that restriction in my script. Does anyone have any suggestions for getting that PID? The first 80

Can a socket be closed from another thread when a send / recv on the same socket is going on?

若如初见. 提交于 2019-12-02 20:53:36
Can a socket be closed from another thread when a send / recv on the same socket is going on? Suppose one thread is in blocking recv call and another thread closes the same socket, will the thread in the recv call know this and come out safely? I would like to know if the behavior will differ between different OS / Platforms. If yes, how will it behave in Solaris? I don't know Solaris network stack implementation but I'll throw out my theory/explanation of why it should be safe. Thread A enters some blocking system call, say read(2) , for this given socket. There's no data in socket receive

How to use qemu to run a non-gui OS on the terminal?

♀尐吖头ヾ 提交于 2019-12-02 17:36:32
I want to run some programs on the High Performance Computer (With 8-core processor) in my department. Now I use that machine with ssh using terminal. The machine has Red Hat linux installed on it. But my programs need to run on Solaris. I use Nexenta Solaris for x86. Can qemu be used to run Nexenta Solaris on that machine through terminal. I need to convince the administrator that it can, otherwise he won't install qemu on that machine and therefore allow me to use Solaris through a virtual machine. Also note that I don't use GUI with the Nexenta Solaris, just command line. In my machine, I

Bus error with allocated memory on a heap

我怕爱的太早我们不能终老 提交于 2019-12-02 12:36:17
I have Bus Error in such code: char* mem_original; int int_var = 987411; mem_original = new char [250]; memcpy(&mem_original[250-sizeof(int)], &int_var, sizeof(int)); ... const unsigned char* mem_u_const = (unsigned char*)mem_original; ... const unsigned char *location = mem_u_const + 250 - sizeof(int); std::cout << "sizeof(int) = " << sizeof(int) << std::endl;//it's printed out as 4 std::cout << "byte 0 = " << int(*location) << std::endl; std::cout << "byte 1 = " << int(*(location+1)) << std::endl; std::cout << "byte 2 = " << int(*(location+2)) << std::endl; std::cout << "byte 3 = " << int(*

grep command on Solaris 9

混江龙づ霸主 提交于 2019-12-02 12:20:39
I faced a strange behavior of a grep command on Solaris 9. For example , I have a host file with two lines: 1.1.1.1 host 1.2.3.4 host-MY I'd like to grep the line contains host string only (not the other line that contain host-MY) I use: grep -Fxq host /etc/hosts but I receive grep: illegal option -- F grep: illegal option -- q grep: illegal option -- x in spite of the fact that this options I can find in grep manual on my Solaris machine You're probably not calling the good grep executable. Run which grep to know which one you are running. On my Solaris box, the official grep is in: > which

psinfo_t solaris does not contain full process name in its field

[亡魂溺海] 提交于 2019-12-02 11:54:33
问题 Not getting full process name in psinfo_t struct's field pr_fname while reading process info from psinfo data file(/proc/%d/psinfo) into struct psinfo_t from procfs.h in solaris. Full psinfo_t struct definition is present on below site: http://docs.oracle.com/cd/E19253-01/816-5174/6mbb98ui2/index.html Only if the process name is less than equal to 15 characters then I am getting the full process name other wise if process name is more than 15 characters then I am getting only first 15

Solaris 11 / Illumos / OmniOS: Which package has /usr/include/sys/types.h?

霸气de小男生 提交于 2019-12-02 09:44:12
问题 The Ubuntu equivalent would be libc6-dev , but I can't seem to find it for Solaris? How can I get types.h and related files for building packages on Solaris or Illumos? 回答1: You need the system/header package. I found this via http://pkg.oracle.com/solaris/release/en/search.shtml?token=types.h&action=Search 回答2: Assuming you use IPS 'pkg search 'types.h'' The Oracle Solaris 11 Cheat Sheet for Image Packaging System could be useful, too. 来源: https://stackoverflow.com/questions/8773535/solaris

通过jstack日志分析和问题排查

喜夏-厌秋 提交于 2019-12-02 08:37:48
简介 jstack用于生成java虚拟机当前时刻的线程快照。线程快照是当前java虚拟机内每一条线程正在执行的方法堆栈的集合,生成线程快照的主要目的是定位线程出现长时间停顿的原因,如线程间死锁、死循环、请求外部资源导致的长时间等待等。 线程出现停顿的时候通过jstack来查看各个线程的调用堆栈,就可以知道没有响应的线程到底在后台做什么事情,或者等待什么资源。 如果java程序崩溃生成core文件,jstack工具可以用来获得core文件的java stack和native stack的信息,从而可以轻松地知道java程序是如何崩溃和在程序何处发生问题。另外,jstack工具还可以附属到正在运行的java程序中,看到当时运行的java程序的java stack和native stack的信息, 如果现在运行的java程序呈现hung的状态,jstack是非常有用的。 一:jstack jstack命令的语法格式: jstack <pid>。可以用jps查看java进程id。这里要注意的是: 1. 不同的 JAVA虚机的线程 DUMP的创建方法和文件格式是不一样的,不同的 JVM版本, dump信息也有差别。 2. 在实际运行中,往往一次 dump的信息,还不足以确认问题。建议产生三次 dump信息,如果每次 dump都指向同一个问题,我们才确定问题的典型性。 二:jstack

awk + fit syntax for SUN solaris & linux

爷,独闯天下 提交于 2019-12-02 07:09:30
问题 need help about the following when I run the following command on linux its run fine awk -v NAME=MACHINE '$1 == NAME' /etc/hosts but on SUN Solaris I get the following: awk -v NAME=MACHINE '$1 == NAME' /etc/hosts awk: syntax error near line 1 awk: bailing out near line 1 how to fit the following syntax in order to fit also SUN Solaris? or change in order to fit both on linux and SUN Solaris 回答1: Solaris is well known for the fact that the some commands under /bin /usr/bin are not POSIX