Hi all,
as followup of this question, I would like to know where the STDOUT and STDERR of a program on which I've run disown -h is redirected to :-)
Thanks!
I am using Eclipse in Linux through a remote connection (xrdp). My internet got disconnected, so I got disconnected from the server while eclipse was running.
Now I logged in again, and I do the "top" command I can see that eclipse is running and still under my user name.
Is there some way I can bring that process back into my view (I do not want to kill it because I am in the middle of checking in a large swath of code)? It doesnt show up on the bottom panel after I logged in again.
Here is the "top" output:
/home/mclouti% top
top - 08:32:31 up 43 days, 13:06, 29 users, load average: 0.56, 0.79, 0.82
Tasks: 447 total, 1 running, 446 sleeping, 0 stopped, 0 zombie
Cpu(s): 6.0%us, 0.7%sy, 0.0%ni, 92.1%id, 1.1%wa, 0.1%hi, 0.1%si, 0.0%st
Mem: 3107364k total, 2975852k used, 131512k free, 35756k buffers
Swap: 2031608k total, 59860k used, 1971748k free, 817816k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13415 mclouti 15 0 964m 333m 31m S 21.2 11.0 83:12.96 eclipse
16040 mclouti 15 0 2608 1348 888 R 0.7 0.0 0:00.12 top
31395 mclouti 15 0 29072 20m 8524 S 0.7 0.7 611:08.08 Xvnc
2583 root 20 0 898m 2652 1056 S 0.3 0.1 139:26.82 automount
28990 postgres 15 0 13564 868 304 S 0.3 0.0 26:33.36 postgres
28995 postgres 16 0 13808 1248 300 S 0.3 0.0 6:54.95 postgres
31440 mclouti 15 0 3072 1592 1036 S 0.3 0.1 6:01.54 gam_server
1 root 15 0 2072 524 496 S 0.0 0.0 0:03.00 init
2 root RT -5 0 0 0 S 0.0 0.0 0:04.53 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.04 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0.0 0.0 0:01.72 migration/1
6 root 34 19 0 0 0 S 0.0 0.0 0:00.07 ksoftirqd/1
7 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
8 root RT -5 0 0 0 S 0.0 0.0 0:04.33 migration/2
9 root 34 19 0 0 0 S 0.0 0.0 0:00.05 ksoftirqd/2
I am on a Mac OSX and I am using the built in PHP and Apache2. I have been setting up MySQL and finally when I got MySQL working my local site won't display. Do note that I did have the web server running and delivering PHP enabled pages, just no database connection. But my question is not about MySQL.
I have changed various settings in the 'http.conf' file, and I have the line: '127.0.0.1 localhost' in my hosts file. I also have other alias' pointing to 127.0.0.1.
I have checked everything I could about Apache and I have made sure that any message in the error_log is ok. I currently have my errorLevel set to debug, so I get all the messages.
At this point (HOURS of self fixing) I think I need help.
What can I provide for someone to figure this out with me.
Thanks.
I have configured supervisord to track my unicorn server process. When I send USR2 process, this performs a rolling restart. After this operation the old unicorn master have restarted and then changed PID.
This caused supervisor to lose track of the unicorn process considering it as EXITED.
How can I have supervisord to follow the new unicorn process after this operation ?
Unicorn has a PID file available, but I have not found an option in supervisord configuration for this.
An other option would be to have supervisord to send itself the USR2 signal, but I don't know how to perform this and whether it will prevent my problem from occurring.
Does anyone know why a system would not execute the script code within rc.local on bootup? I have a post configuration bash script that I want to run after the initial install of VMware ESX (Red Hat), and for some reason it doesn't seem to execute. I have the setup to log its start of execution and even its progress so that I can see how far it gets in case it fails at some point, but even when I look at that log, I am finding that didn't even started the execution of the script code. I already checked to see that script has execution permissions (755), what else should I be looking at?
Here is the first few lines of my code:
#!/bin/sh
echo >> /tmp/configLog ""
echo >> /tmp/configLog "Entering maintenance mode"
Hi All,
I recently ran into a problem where a Solaris server could not establish a TCP socket on port 2126. From a packet capture I see this (note: A is a Solaris server, B is a router):
A sends SYN to B
B sends SYN, ACK to A
Notice A (Solaris) does not acknowledge the SYN from B.
Due to the business impact of the problem, I had to reboot the server to fix the problem. That said, I want to know the next time the problem occurs, what can I do to get a root cause (ie before server reboot)?
Thanks in advance.
Hello everyone, I'm a total newb to *nix in all forms so assume I know nothing about it.
I've been trying to use a php function set called "ZipArchive". It says I need to recompile php with the --enable-zip option.
Now "recompile php" scares me. Does that re-install it!? Does it clear all previous settings so if I do this then any settings done prior will be wiped? Or is there a way to add on this one option?
Seems a bit much for a re-installation to add a model when on a windows server it is just add a line to the .ini file :\
Many thanks to anyone who can clear up this matter for me :)
I use bash shell and sometimes all of a sudded, my Backspace key stops working (when this happens Ctrl + Backspace still works fine)
I am not sure why this happens, but it also carries over to any vim sessions that I use from the shell. To my surprise, getting a fresh shell does not help, and the problem seems to go away as abruptly as it started.
This is what the typed characters look like, each Backspace keypress is shown by a ^? on the shell
$ cat filem^?namr^?e
Does anybody have a clue what might be happening? How can I restore the normal behaviour?
1) Here is the command to install special package (for example system/header)
#pkg install system/header
2) ALso we can install several packages
#pkg install system/header network/ssh package/rpm
3) Here is the command to show all available packages from special group
#pkg contents -o fmri -H -rt depend -a type=group solaris-desktop
How to install all packages from a special group in one command? (How to send output from the third command as an argument to second?)
I am copying some files (all except hidden ones) using rsync from one place to another using this command:
rsync -Cav --delete --exclude=.* /Some/Directory/ other-host:/Other/Directory
It works nice except that I get the following errors:
rsync: chgrp "/Other/Directory/." failed: Operation not permitted (1)
rsync: failed to set times on "/Other/Directory/.": Permission denied (13)
That is understandable because I do in fact not have those permissions, and I also do not want to change the group of that directory. I only want to do this for all the files and directories that are in that directory. Is there any way to solve this? Tried to --exclude=. and --exclude=./, but those didn't work.
Any ideas? I have no idea how to fix this...
More details: This is on Mac OS X, and the directories I am syncing is from a local mounted volume to the /Users/Shared/ directory on the other host. That directory has user root and group wheel. The files inside it has user admin and group staff and so does the local source directory.
I need to start screen with some bash command to execute.
Trying screen -S test -d -m bash -c './test.php'
but have no result, screen didn't apear.
Even more, let's that i need to start something like that
vlc -I ncurses --http-reconnect http://ip/ --sout '#duplicate{dst=std{access=http{user=,pwd=},mux=ts,dst=:51001}}' --ttl=255 --loop --repeat
So I'm doing full backup of my VPS using the following command (as root, of course):
tar czvf 20120604.tar.gz /
Everything seems to be fine, all files seem to appear in the list. The size of archive is 6 Gb and gunzipped version is 11 Gb which includes /home, because I totally have 11 Gb of data on VPS.
But when I try actually to unpack archive, or open it using mc or WinRAR, there's no /home folder. And WinRAR tells 20120604.tar.gz - TAR+GZIP archive, unpacked size 894 841 346 bytes. It can't be WinRAR's bug, because when I type tar xzvf 20120604.tar.gz, /home folder isn't unpacked either.
Why is /home folder missing from my archive? And what can I do to include it there?
tar --version outputs the following: tar (GNU tar) 1.15.1
So, I just installed the node.js package from nodejs.org and I was poking around to see what it installed. Over in /usr/local/bin I saw this owner 24561. I see it in a few other places too. What is this? What does it mean? Should it be root like everything else?
lrwxr-xr-x 1 root wheel 66 Jun 23 13:02 mate -> /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate
-rwxr-xr-x 1 24561 wheel 18865984 Jun 29 09:32 node
-rwxr-xr-x 1 24561 wheel 355 Jun 29 09:32 node-waf
lrwxr-xr-x 1 root wheel 38 Jul 3 12:15 npm -> ../lib/node_modules/npm/bin/npm-cli.js
What was curious is that I couldn't find any other information about this user by Googling. Using OS X Lion 10.7.4 with Xcode installed if that makes any difference.
I have a Perl script that I want to daemonize. Basically this perl script will read a directory every 30 seconds, read the files that it finds and then process the data. To keep it simple here consider the following Perl script (called synpipe_server, there is a symbolic link of this script in /usr/sbin/) :
#!/usr/bin/perl
use strict;
use warnings;
my $continue = 1;
$SIG{'TERM'} = sub { $continue = 0; print "Caught TERM signal\n"; };
$SIG{'INT'} = sub { $continue = 0; print "Caught INT signal\n"; };
my $i = 0;
while ($continue) {
#do stuff
print "Hello, I am running " . ++$i . "\n";
sleep 3;
}
So this script basically prints something every 3 seconds.
Then, as I want to daemonize this script, I've also put this bash script (also called synpipe_server) in /etc/init.d/ :
#!/bin/bash
# synpipe_server : This starts and stops synpipe_server
#
# chkconfig: 12345 12 88
# description: Monitors all production pipelines
# processname: synpipe_server
# pidfile: /var/run/synpipe_server.pid
# Source function library.
. /etc/rc.d/init.d/functions
pname="synpipe_server"
exe="/usr/sbin/synpipe_server"
pidfile="/var/run/${pname}.pid"
lockfile="/var/lock/subsys/${pname}"
[ -x $exe ] || exit 0
RETVAL=0
start() {
echo -n "Starting $pname : "
daemon ${exe}
RETVAL=$?
PID=$!
echo
[ $RETVAL -eq 0 ] && touch ${lockfile}
echo $PID > ${pidfile}
}
stop() {
echo -n "Shutting down $pname : "
killproc ${exe}
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f ${lockfile}
rm -f ${pidfile}
fi
}
restart() {
echo -n "Restarting $pname : "
stop
sleep 2
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status ${pname}
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
;; esac
exit 0
So, (if I have well understood the doc for daemon) the Perl script should run in the background and the output should be redirected to /dev/null if I execute :
service synpipe_server start
But here is what I get instead :
[root@master init.d]# service synpipe_server start
Starting synpipe_server : Hello, I am running 1
Hello, I am running 2
Hello, I am running 3
Hello, I am running 4
Caught INT signal
[ OK ]
[root@master init.d]#
So it starts the Perl script but runs it without detaching it from the current terminal session, and I can see the output printed in my console ... which is not really what I was expecting. Moreover, the PID file is empty (or with a line feed only, no pid returned by daemon).
Does anyone have any idea of what I am doing wrong ?
EDIT : maybe I should say that I am on a Red Hat machine.
Scientific Linux SL release 5.4 (Boron)
Would it do the job if instead of using the daemon function, I use something like :
nohup ${exe} >/dev/null 2>&1 &
in the init script ?
I am configuring a Linux Server with ACL[Access Control Lists]. It is not allowing me to perform setfacl operation on one of the directoriy /xfiles. I am able to perform the setfacl on other directories as /tmp /op/applocal/.
I am getting the error as :
root@asifdl01devv # setfacl -m user:eqtrd:rw-,user:feedmgr:r--,user::---,group::r--,mask:rw-,other:--- /xfiles/change1/testfile
setfacl: /xfiles/change1/testfile: Operation not supported
I have defined my /etc/fstab as
/dev/ROOTVG/rootlv / ext3 defaults 1 1
/dev/ROOTVG/varlv /var ext3 defaults 1 2
/dev/ROOTVG/optlv /opt ext3 defaults 1 2
/dev/ROOTVG/crashlv /var/crash ext3 defaults 1 2
/dev/ROOTVG/tmplv /tmp ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/ROOTVG/swaplv swap swap defaults 0 0
/dev/APPVG/home /home ext3 defaults 1 2
/dev/APPVG/archives /archives ext3 defaults 1 2
/dev/APPVG/test /test ext3 defaults 1 2
/dev/APPVG/oracle /opt/oracle ext3 defaults 1 2
/dev/APPVG/ifeeds /xfiles ext3 defaults 1 2
I have a solaris server where the vfstab is defined as
cat vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/vx/dsk/bootdg/swapvol - - swap - no -
swap - /tmp tmpfs - yes size=1024m
/dev/vx/dsk/bootdg/rootvol /dev/vx/rdsk/bootdg/rootvol / ufs 1 no logging
/dev/vx/dsk/bootdg/var /dev/vx/rdsk/bootdg/var /var ufs 1 no logging
/dev/vx/dsk/bootdg/home /dev/vx/rdsk/bootdg/home /home ufs 2 yes logging
/dev/vx/dsk/APP/test /dev/vx/rdsk/APP/test /test vxfs 3 yes -
/dev/vx/dsk/APP/archives /dev/vx/rdsk/APP/archives /archives vxfs 3 yes -
/dev/vx/dsk/APP/oracle /dev/vx/rdsk/APP/oracle /opt/oracle vxfs 3 yes -
/dev/vx/dsk/APP/xfiles /dev/vx/rdsk/APP/xfiles /xfiles vxfs 3 yes -
I am not able to find out the issue. Any help would be appreciated.
Hi all,
I have solaris 10 sparc running and working very well
but i have problem with external SCSI tape drive DAT 72 problem
it seems to me the tape drive is manufactured by SUN microsystems
when i ran mt -f /dev/rmt/0 status
it reveals the following output
bash-3.00# mt -f /dev/rmt/0 status
/dev/rmt/0: No such file or directory
when i ran ls -l
it reveals the following output
ls -l /dev/rmt/0
lrwxrwxrwx 1 root root 43 Sep 20 2006 /dev/rmt/0 -> ../../devices/pci@8,600000/scsi@1,1/st@3,0:
it seems to me everything is okay
SCSI cable is connected properly to Tape device and to server as well
the tape has SCSI termination dongle as well and connected properly to Tape device as well
any ideas would be a great assist
Thanks in advance
I need to config one SMTP server (sendmail) to send mail with 2 interfaces with different ip's depending server.
For example: In same machine with to ip: 1.1.1.1 and 2.2.2.2 i need to send email [email protected] by 1.1.1.1 and [email protected] by 2.2.2.2
I don't now if i can configure it on sendmail, or use iptables, some idea ?
Thx.
I've managed to get my Ubuntu (server 10.04 beta 2) box to accept logins from users with Active Directory credentials, now I'd like those users to access there permissible windows shares on a W2003 R2 server.
The Windows share ("\srv\Users\") has subdirectories named according to the domain account users and permissions are set accordingly. I would like to preserve these permissions, but don't know how to go about it.
Would I mount as an AD administrator or have each user mount with there own AD credentials?
How do determine between using mount.smbfs or mount.cifs?
I want to archive all .ctl files in a folder, recursively.
tar -cf ctlfiles.tar `find /home/db -name "*.ctl" -print`
The error message :
tar: Removing leading `/' from member names
tar: /home/db/dunn/j: Cannot stat: No such file or directory
tar: 74.ctl: Cannot stat: No such file or directory
I have these files: /home/db/dunn/j 74.ctl and j 75. Notice the extra space. What if the files have other special characters? How do I archive these files recursively?
I have 3 Varnish 3.0.2 servers with Apache 2 as backends, which are being load balanced through a HAproxy separate server.
I need to find a very simple program (I'm not much of a sysadmin), which blocks requests from an IP, if that IP has made more than X requests in Y seconds.
Would something like this be achievable with a simple solution? Right now I have to block all requests manually with iptables.
So if i do eject on my machine, it works exactly as expected, however, if i ssh into the machine next to me, and do the same thing, it does not work...
my computer:
eject: using default device `cdrom'
eject: device name is `cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/sr0'
eject: `/dev/sr0' is not mounted
eject: `/dev/sr0' is not a mount point
eject: checking if device "/dev/sr0" has a removable or hotpluggable flag
eject: `/dev/sr0' is not a multipartition device
eject: trying to eject `/dev/sr0' using CD-ROM eject command
eject: CD-ROM eject command succeeded
other computer:
eject: using default device `cdrom'
eject: device name is `cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/sr0'
eject: `/dev/sr0' is not mounted
eject: `/dev/sr0' is not a mount point
eject: checking if device "/dev/sr0" has a removable or hotpluggable flag
eject: `/dev/sr0' is not a multipartition device
eject: unable to open `/dev/sr0'
if i look in the /dev/ dir, then i find cdrom which is a symlink to sr0 - as mentioned by the verbose outputs of eject -v. On my machine, if i try and look at it, if the drive is open, it will close it, and then give this:
$ less sr0
sr0 is not a regular file (use -f to see it)
so
$ less -f sr0
sr0: No medium found
but if i do it on the other computer,
$ less -f sr0
sr0: Permission denied
so i look at the files more, and get this on both machines:
$ ls -la sr0
brw-rw----+ 1 root cdrom 11, 0 Nov 12 10:13 sr0
Does anyone know a way around this? I do not have root access.
I have sshed into a linux box and I'm using dvtm and bash (although I have also tried this with Gnu screen and bash). I have two terminals, current /dev/pts/29 and /dev/pts/130. I want to redirect the input from one to the other.
From what I understand, in /dev/pts/130 I can type:
cat </dev/pts/29
And then when I type in /dev/pts/29 the characters I type should show up in /dev/pts/130. However what ends up happening is that every other character I type gets redirected. For example, if I type "hello" I get this:
/dev/pts/29 | /dev/pts/130
$ | $ cat </dev/pts/29
$ el | hlo
This is really frustrating as I need to do this in order to redirect the io of a process running in gdb (I've tried both run /dev/pts/# and set inferior-tty /dev/pts/# and both resulted in the aforementioned behavior). Am I doing something wrong, or is this a bug in bash/screen/dvtm?
I use bash shell
$ bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
$
Sometimes, when typing a command on the prompt that is pretty lengthy and does not fit in the current line, instead of displaying the extra characters on the next line, bash starts again on the current line.. replacing the characters that were there and making a mess.
what should happen :
|---------------------------------------------|
| $ my big long command takes a lot of argumen|
| s and does not fit in a single line |
| |
|---------------------------------------------|
what happens instead :
|---------------------------------------------|
| s and does not fit in a single linef argumen|
| |
| |
|---------------------------------------------|
The issue is intemittent
If I resize my shell window to really small width, normal behaviour is restored
Does anyone have any idea what is happening here?
$ echo $TERM
xterm
$ echo $PS1
\[\e[30m\][\t]\[\e[0m\]\[\e]0;\w\a\]\[\e[30m\][\W]$
$
I have a folder which contains a certain number of files which have hard links (in the same folder or somewhere else), and I want to de-hardlink these files, so they become independant, and changes to their contents won't affect any other file (their link count becomes 1).
Below, I give a solution which basically copies each hard link to another location, then move it back in place.
However this method seems rather crude and error-prone, so I'd like to know if there is some command which will de-hardlink a file for me.
Crude answer :
Find files which have hard links (Edit: To also find sockets, etc. that have hardlinks, use find -not -type d -links +1) :
find -type f -links +1
A crude method to de-hardlink a file (copy it to another location, and move it back) :
Edit: As Celada said, it's best to do a cp -p below, to avoid loosing timestamps and permissions. Edit: Create a temporary directory and copy to a file under it, instead of overwriting a temp file, it minimizes the risk to overwrite some data, though the mv command is still risky (thanks @Tobu).
# This is unhardlink.sh
set -e
for i in "$@"; do
temp="$(mktemp -d ./hardlnk-XXXXXXXX)"
[ -e "$temp" ] && cp -ip "$i" "$temp/tempcopy" && mv "$temp/tempcopy" "$i" && rmdir "$temp"
done
So, to un-hardlink all hard links (Edit: changed -type f to -not -type d, see above) :
find -not -type d -links +1 -print0 | xargs -0 unhardlink.sh