Hello all,
I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted.
Thanks in advance
Regards,
pradeep kulkarni.
:mad: (13 Replies)
Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it
This is how we execute the script (and this is the requirement) ... (2 Replies)
Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know.
More detail.
ScriptA (bash), ScriptB (ksh), ScriptC (bash)
ScriptA, launches ScriptB
ScirptB,... (7 Replies)
get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same.
hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Hi Experts,
I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state.
On doing cat /proc/<pid>wchan showing the "__init_begin" in the output.
Can you please help me here... (0 Replies)
Hi Experts,
I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state.
On doing cat /proc/<pid>wchan showing the "__init_begin" in the output.
Can you please help me here... (1 Reply)
Hi Experts,
I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state.
On doing cat /proc/<pid>wchan showing the "__init_begin" in the output.
Can you please help me here... (6 Replies)
I am writing a script to kick off a process to gather logs on multiple nodes in parallel using "&". These processes create individual log files. Which I would like to filter and convert in CSV format after they are complete. I am facing following issues:
1. Monitor all Processes parallelly.... (5 Replies)
Team,
I have multiple batchjobs running in VM, if I do ps -ef |grep java or tomcat I am getting multiple process list.
How do I get my exact tomcat process running and that is unique? via shell script? (4 Replies)
Discussion started by: Ghanshyam Ratho
4 Replies
LEARN ABOUT DEBIAN
sd_pid_get_owner_uid
SD_PID_GET_SESSION(3) sd_pid_get_session SD_PID_GET_SESSION(3)NAME
sd_pid_get_session, sd_pid_get_unit, sd_pid_get_owner_uid - Determine session, service or owner of a session of a specific PID
SYNOPSIS
#include <systemd/sd-login.h>
int sd_pid_get_session(pid_t pid, char** session);
int sd_pid_get_unit(pid_t pid, char** unit);
int sd_pid_get_owner_uid(pid_t pid, uid_t* uid);
DESCRIPTION
sd_pid_get_session() may be used to determine the login session identifier of a process identified by the specified process identifier. The
session identifier is a short string, suitable for usage in file system paths. Note that not all processes are part of a login session
(e.g. system service processes, user processes that are shared between multiple sessions of the same user, or kernel threads). For
processes not being part of a login session this function will fail. The returned string needs to be freed with the libc free(3) call after
use.
sd_pid_get_unit() may be used to determine the systemd unit (i.e. system service) identifier of a process identified by the specified
process identifier. The unit name is a short string, suitable for usage in file system paths. Note that not all processes are part of a
unit/service (e.g. user processes, or kernel threads). For processes not being part of a systemd unit/system service this function will
fail. The returned string needs to be freed with the libc free(3) call after use.
sd_pid_get_owner_uid() may be used to determine the Unix user identifier of the owner of the session of a process identified the specified
PID. Note that this function will succeed for user processes which are shared between multiple login sessions of the same user, where
sd_pid_get_session() will fail. For processes not being part of a login session and not being a shared process of a user this function will
fail.
If the pid paramater of any of these functions is passed as 0 the operation is executed for the calling process.
RETURN VALUE
On success these calls return 0 or a positive integer. On failure, these calls return a negative errno-style error code.
NOTES
The sd_pid_get_session(), sd_pid_get_pid(), and sd_pid_get_owner_uid() interfaces are available as shared library, which can be compiled
and linked to with the libsystemd-login pkg-config(1) file.
Note that the login session identifier as returned by sd_pid_get_session() is completely unrelated to the process session identifier as
returned by getsid(2).
SEE ALSO systemd(1), sd-login(7), sd_session_is_active(3), getsid(2)AUTHOR
Lennart Poettering <lennart@poettering.net>
Developer
systemd 10/07/2013 SD_PID_GET_SESSION(3)