solaris

How to extract NFS information from mount on Linux and Solaris?

不想你离开。 提交于 2019-12-10 19:27:44
问题 I need to extract NFS mount information using mount on Linux (RHEL 4/5) and Solaris (Solaris 10) systems. As this is part of an SSH command, the extraction needs to happen in one line. Unfortunately, Linux and Solaris display the mountpoint at different parts of the line: Linux: 10.0.0.1:/remote/export on /local/mountpoint otherstuff Solaris: /local/mountpoint on 10.0.0.1:/remote/export otherstuff I would like to get the following space separated output 10.0.0.1 /remote/export /local

Are shell scripts read in their entirety when invoked?

倖福魔咒の 提交于 2019-12-10 19:08:07
问题 I ask because I recently made a change to a KornShell (ksh) script that was executing. A short while after I saved my changes, the executing process failed. Judging from the error message, it looked as though the running process had seen some -- but not all -- of my changes. This strongly suggests that when a shell script is invoked, the entire script is not read into memory. If this conclusion is correct, it suggests that one should avoid making changes to scripts that are running. $ uname

Equivalent lsof -i in Solaris

回眸只為那壹抹淺笑 提交于 2019-12-10 18:43:54
问题 I have a fast question. I want to know what is the losf -i equivalent command in a Solaris system. I only want to show the files with network connection. Thank you!! 回答1: Here is a shell script that list all processes having open TCP or UDP ports on Solaris, you can limit it to a given port number by passing it as an argument: pfiles /proc/* 2>/dev/null | nawk -v port=$1 ' /^[0-9]/ { cmd=$2; type="unknown"; continue } $1 == "SOCK_STREAM" { type="tcp" } $1 == "SOCK_DGRAM" { type="udp" } $2 ~

ColdFusion, CFDirectory and the French

非 Y 不嫁゛ 提交于 2019-12-10 18:07:16
问题 We have a ColdFusion file library management system that is being taken off an old ColdFusion 4 server and moved onto the new system which is based on ColdFusion 8. All our files and folders are in English, French and Spanish. Using CFDirectory in CF8 to load and display these files and folders is causing two issues with the French and Spanish files and folders, but the two problems are probably linked. Directories with accented characters are not being returned from the cfdirectory. Files

How can I find out the original username a process was started with?

我怕爱的太早我们不能终老 提交于 2019-12-10 17:34:03
问题 There is a perl script that needs to run as root but we must make sure the user who runs the script did not log-in originally as user 'foo' as it will be removed during the script. So how can I find out if the user, who might have su-ed several times since she logged in has not impersonated 'foo' at any time in that chain? I found an interesting perl script that was calling the following two shell scripts, but I think that would only work on Solaris. my $shell_parent = `ps -ef | grep -v grep

TCP Servers: Drop Connection, instead of resetting or responding?

感情迁移 提交于 2019-12-10 17:16:02
问题 Is it possible in Node.JS to "drop" a connection in such a way that The client never receives a response (200, 404 or otherwise) The client is never notified that the connection is terminated (never receives connection reset or end of stream) The server's resources are released (the server should not attempt to maintain the connection in any way) I am specifically asking about Node.JS HTTP Servers (which are really just complex TCP servers) on Solaris., but if there are cases on other OSes

canonicalize a path name on solaris

半世苍凉 提交于 2019-12-10 15:55:54
问题 On a GNU system I would just use readlink -f $SOME_PATH , but Solaris doesn't have readlink. I'd prefer something that works well in bash, but other programs are ok if needed. Edit: The best I've come up with so far uses cd and pwd, but requires some more hackery to deal with files and not just directories. cd -P "$*" REAL_PATH=`pwd` 回答1: Does this help? From the referenced page: Create a file called canonicalize with these contents: #!/bin/bash cd -P -- "$(dirname -- "$1")" && printf '%s\n'

Mismatch between constructor definition and declaration

巧了我就是萌 提交于 2019-12-10 14:10:23
问题 I had the following C++ code, where the argument to my constructor in the declaration had different constness than the definition of the constructor. //testClass.hpp class testClass { public: testClass(const int *x); }; //testClass.cpp testClass::testClass(const int * const x) {} I was able to compile this with no warnings using g++, should this code compile or at least give some warnings? It turns out that the built-in C++ compiler on 64 bit solaris gave me a linker error, which is how I

CentOS7的LVM动态扩容

杀马特。学长 韩版系。学妹 提交于 2019-12-10 13:44:01
问题 CentOS7上面的磁盘空间有点紧张,需要扩容。 解决 查询当前磁盘状态 [root@xxx ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 200G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 0 15.5G 0 part ├─centos-swap 253:0 0 1.6G 0 lvm [SWAP] └─centos-root 253:1 0 13.9G 0 lvm / sr0 11:0 1 1024M 0 rom loop0 7:0 0 4.3G 0 loop /mnt/iso 查询当前文件系统状态 [root@xxx ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/centos-root 14G 14G 20K 100% / devtmpfs 3.8G 0 3.8G 0% /dev tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs 3.9G 442M 3.4G 12% /run tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/sda1 497M 295M 202M 60% /boot tmpfs 782M

Tee does not exit after pipeline it's on has finished [closed]

余生颓废 提交于 2019-12-10 12:39:17
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . So, I've got a rather long and involved script intended to be used by people who aren't going to want to dig into anything that goes wrong. Recently,