Sponsored Content
Full Discussion: PID missing on my File.
Top Forums Shell Programming and Scripting PID missing on my File. Post 303000596 by mohtashims on Saturday 15th of July 2017 05:08:25 AM
Old 07-15-2017
PID missing on my File.

I have 3 files namely run1.cmd, run2.cmd & run3.cmd

Code:
more run1.cmd

cd /tmp/scripts/app1/
nohup ./startserver.sh &

more run2.cmd

cd /tmp/scripts/app2/
nohup ./startserver.sh &

more run3.cmd

cd /tmp/scripts/app3/
nohup ./startserver.sh &

These scripts are kept on my [Linux] ansible server [SERVER-A]

I wish to execute these scripts executeall.sh from [SERVER-A] onto a remote Solaris server [SERVER-B] using ansible [ssh] tool like below.

Code:
more executeall.sh
./run1.cmd
./run2.cmd
./run3.cmd

After execution from SERVER-A i go to SERVER-B to check if the process is running.

On SERVER-B i see the three process running but strangely the process PID is not logging to nohup.out

Code:
fuser /tmp/scripts/app1/nohup.out
No Output

instead the PID is is showing for

Code:
fuser /tmp/scripts/app1/startserver.sh
: 23455o

Thus i also do not find any logging happening on nohup.out.

However, when i run the below

Code:
./run1.cmd
./run2.cmd
./run3.cmd

directly on SERVER-B i see the nohup.out logging and PID on nohup.out as desired.

Can you please explain why do i see this strange behavior and how can i address this problem ?

Last edited by mohtashims; 07-15-2017 at 11:53 AM..
 

10 More Discussions You Might Find Interesting

1. IP Networking

what is the httpd.pid file usualy used for??

HI am new to unix! So i was looking one day at the server and i saw a file called httpd.pid,:confused: i asked the administrator but he didnt wanted to tel me so if you guys can help me that will be greath/... Thanks , BeoWulf (1 Reply)
Discussion started by: beo
1 Replies

2. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies

3. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

4. UNIX for Dummies Questions & Answers

Retrieving PID from a file

Hello I need to retrieve the content of a file in the shell script file(.sh file). I store the Process ID of the a process in file.Only the PID is available in that file. Inside the shell script i want to retireve the content(PID) and need to check for the existence of the Process.Basically... (5 Replies)
Discussion started by: appleforme1415
5 Replies

5. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

6. UNIX for Advanced & Expert Users

netstat -p, missing PID/program name

I have a netstat command set up with awk to show which ports my box is listening on. The -p switch shows the PID/program name, too, which ordinarily would be very handy. However, several entries show up as just "-" for the program name which makes it hard to identify what is keeping the port open.... (2 Replies)
Discussion started by: Bilge
2 Replies

7. AIX

kill -3 <PID> ... where the output file goes?

Hi all, I am generating the coredump of my JBoss, and by default it puts it in to a particular directory. i.e. JBOSS_HOME/. I would like this output file to be created, lets say in /tmp/dump/. I tried the following: kill -3 9404940>/tmp/dump/out.txt But it created... (3 Replies)
Discussion started by: haroon_a
3 Replies

8. UNIX for Dummies Questions & Answers

Check who is writing to a file? (pid)

Hello, is there a way to check who is writing to a file? (pid) Like someone starts a ftp transfer, is uploading a file and I'd need to know which pid is actually writing to it. Or is there a way to check which file a process is currently accessing? Greetings and thanks for all your... (4 Replies)
Discussion started by: TehOne
4 Replies

9. Shell Programming and Scripting

Systemd errors of missing file “No such file or directory” inspite of file being present

The contents of my service file srvtemplate-data-i4-s1.conf is Description=test service for users After=network.target local-fs.target Type=forking RemainAfterExit=no PIDFile=/data/i4/srvt.pid LimitCORE=infinity EnvironmentFile=%I . . . WantedBy=multi-user.target (0 Replies)
Discussion started by: rupeshkp728
0 Replies

10. UNIX for Beginners Questions & Answers

Pid file and process check

Hello, I am running ubuntu14.04 What I am trying to do is restart a process with a shell when pid is dead. I restored pid nr in a file and check with ps aux | grep -v grep | grep $(cat *.pid)| awk '{ print $2 }' While surfing on google, I have found an answer saying that restoring pid in a... (2 Replies)
Discussion started by: baris35
2 Replies
PAM_FILTER(8)							 Linux-PAM Manual						     PAM_FILTER(8)

NAME
pam_filter - PAM filter module SYNOPSIS
pam_filter.so [debug] [new_term] [non_term] run1|run2 filter [...] DESCRIPTION
This module is intended to be a platform for providing access to all of the input/output that passes between the user and the application. It is only suitable for tty-based and (stdin/stdout) applications. To function this module requires filters to be installed on the system. The single filter provided with the module simply transposes upper and lower case letters in the input and output streams. (This can be very annoying and is not kind to termcap based editors). Each component of the module has the potential to invoke the desired filter. The filter is always execv(2) with the privilege of the calling application and not that of the user. For this reason it cannot usually be killed by the user without closing their session. OPTIONS
debug Print debug information. new_term The default action of the filter is to set the PAM_TTY item to indicate the terminal that the user is using to connect to the application. This argument indicates that the filter should set PAM_TTY to the filtered pseudo-terminal. non_term don't try to set the PAM_TTY item. runX In order that the module can invoke a filter it should know when to invoke it. This argument is required to tell the filter when to do this. Permitted values for X are 1 and 2. These indicate the precise time that the filter is to be run. To understand this concept it will be useful to have read the pam(3) manual page. Basically, for each management group there are up to two ways of calling the module's functions. In the case of the authentication and session components there are actually two separate functions. For the case of authentication, these functions are pam_authenticate(3) and pam_setcred(3), here run1 means run the filter from the pam_authenticate function and run2 means run the filter from pam_setcred. In the case of the session modules, run1 implies that the filter is invoked at the pam_open_session(3) stage, and run2 for pam_close_session(3). For the case of the account component. Either run1 or run2 may be used. For the case of the password component, run1 is used to indicate that the filter is run on the first occasion of pam_chauthtok(3) (the PAM_PRELIM_CHECK phase) and run2 is used to indicate that the filter is run on the second occasion (the PAM_UPDATE_AUTHTOK phase). filter The full pathname of the filter to be run and any command line arguments that the filter might expect. MODULE TYPES PROVIDED
All module types (auth, account, password and session) are provided. RETURN VALUES
PAM_SUCCESS The new filter was set successfully. PAM_ABORT Critical error, immediate abort. EXAMPLES
Add the following line to /etc/pam.d/login to see how to configure login to transpose upper and lower case letters once the user has logged in: session required pam_filter.so run1 /lib/security/pam_filter/upperLOWER SEE ALSO
pam.conf(5), pam.d(5), pam(8) AUTHOR
pam_filter was written by Andrew G. Morgan <morgan@kernel.org>. Linux-PAM Manual 04/01/2010 PAM_FILTER(8)
All times are GMT -4. The time now is 11:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy