Sponsored Content
Full Discussion: processes
Top Forums UNIX for Dummies Questions & Answers processes Post 26207 by mma_buc_98 on Tuesday 13th of August 2002 02:54:03 PM
Old 08-13-2002
processes

What command string will locate ONLY the PID of a process and ouput only the number of PID of the process?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

co-processes

Is it possible to have a main script (i will call it main.ksh) that executes say, 4 other scripts (sub_prog_1.ksh, sub_prog_2.ksh etc..) from within this main.ksh (simultaneously/in parallel), have them run in the background and communicate back to main.ksh when complete? My guess is to use... (1 Reply)
Discussion started by: google
1 Replies

2. Shell Programming and Scripting

I need some example of Co-Processes

I want to know how to work the Co-Processes in kornshell scripts. So, I very need some script about Co-Processes! thanks ...:) (3 Replies)
Discussion started by: javalee
3 Replies

3. Filesystems, Disks and Memory

processes

write a program create two processes to run a for loop which adds numbers 1 to n , say one process adds odd numbers and other adds even numbers (1 Reply)
Discussion started by: jayaram_miryabb
1 Replies

4. UNIX for Dummies Questions & Answers

Processes

Can someone tell how to find out how long a process has been running? I want to find something that is usually there that the paging system can check on. Thanks (4 Replies)
Discussion started by: Beetlejuice
4 Replies

5. Shell Programming and Scripting

Processes

I have a file like this. No. State Query Times User Processed Syslog 1 ready idle 973s 0 /Application/ugsvols/bldata01/logs/imanscript1562.syslog 2 ready idle 803s 83997 13 /Application/ugsvols/bldata01/logs/imanscript1542.syslog 3 ready idle 2954s 106641... (17 Replies)
Discussion started by: Krrishv
17 Replies

6. UNIX for Advanced & Expert Users

Monitoring Processes - Killing hung processes

Is there a way to monitor certain processes and if they hang too long to kill them, but certain scripts which are expected to take a long time to let them go? Thank you Richard (4 Replies)
Discussion started by: ukndoit
4 Replies

7. Solaris

Identifying and grouping OS processes and APP processes

Hi Is there an easy way to identify and group currently running processes into OS processes and APP processes. Not all applications are installed as packages. Any free tools or scripts to do this? Many thanks. (2 Replies)
Discussion started by: wilsonee
2 Replies

8. UNIX for Dummies Questions & Answers

Processes

Hi all, I needed a little help. It's OS thing. Suppose I have 2 machine connect over a network, I will call my machines as M1and M2. If I copy a files from M1 to M2. What tasks are these two machine performing for copy to work. My assumption is that M1 is performing read action and... (1 Reply)
Discussion started by: vishwesh
1 Replies

9. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

10. UNIX for Dummies Questions & Answers

processes

may i know a command to find processes not attached to a terminal?? (1 Reply)
Discussion started by: riya9
1 Replies
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_user_unit, sd_pid_get_owner_uid, sd_pid_get_machine_name, sd_pid_get_slice - Determine session, service, owner of a session, container/VM or slice 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_user_unit(pid_t pid, char** unit); int sd_pid_get_owner_uid(pid_t pid, uid_t* uid); int sd_pid_get_machine_name(pid_t pid, char** name); int sd_pid_get_slice(pid_t pid, char** slice); 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 system unit (i.e. system service) identifier of a process identified by the specified PID. The unit name is a short string, suitable for usage in file system paths. Note that not all processes are part of a system unit/service (e.g. user processes, or kernel threads). For processes not being part of a systemd system unit this function will fail. (More specifically: this call will not work for processes that are part of user units, use sd_pid_get_user_unit() for that.) The returned string needs to be freed with the libc free(3) call after use. sd_pid_get_user_unit() may be used to determine the systemd user unit (i.e. user service) identifier of a process identified by the specified PID. This is similar to sd_pid_get_unit() but applies to user units instead of system units. 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. sd_pid_get_machine_name() may be used to determine the name of the VM or container is a member of. The machine name is a short string, suitable for usage in file system paths. The returned string needs to be freed with the libc free(3) call after use. sd_pid_get_slice() may be used to determine the slice unit the process is a member of. See systemd.slice(5) for details about slices. The returned string needs to be freed with the libc free(3) call after use. If the pid parameter 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_unit(), sd_pid_get_user_unit(), sd_pid_get_owner_uid(), sd_pid_get_machine_name() and sd_pid_get_slice() interfaces are available as a 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(3), sd_session_is_active(3), getsid(2), systemd.slice(5) systemd 208 SD_PID_GET_SESSION(3)
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy