10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I wish to pull out a list of all user ids on the system, including the privileged ids, the groups to which they belong to. Sometimes after deleting an id also, its home dir does not get deleted or an entry is left behind in /etc/passwd.
Can someone help me with a script to achieve both. (2 Replies)
Discussion started by: ggayathri
2 Replies
2. Shell Programming and Scripting
Hi,
I need to list out the processes which are started/restarted today in my Solaris box. If not possible need to convert the process uptime in minutes or seconds and compare it with a configurable value to list out those process ids for further processing in my scripting.
Can any one guide... (7 Replies)
Discussion started by: ananan
7 Replies
3. Shell Programming and Scripting
Hi,
I have four tomcat instances named PNK, PNK1, PNK2, PNK3.
All are running on the same server.
To kill tomcat instance I usually do below for PNK1,PNK2,PNK3
kill -9 `ps -ef|grep tomcat|grep PNK1|grep -v grep|awk '{print $2}'`
But the above command does not work for PNK. Can some... (7 Replies)
Discussion started by: lpprasad321
7 Replies
4. Shell Programming and Scripting
Please help me with this question
I have a tantan.sh under /home/mydir which is a caller to another script "tantan.sh" under /home/anotherdir
-----------------------------------------------------------
/home/mydir/tantan.sh
------------------------------------------------------------... (6 Replies)
Discussion started by: guruincredible
6 Replies
5. Shell Programming and Scripting
Hi,
I need a script to kill the process Ids for the user ABC.
I prepared the following script after that while logging with user therough script i am not sure how to pass the user name and password.Can ou modify the script and help me out.
#!/bin/bash
for filesize in $(ls -ltr | grep... (4 Replies)
Discussion started by: victory
4 Replies
6. AIX
Hi All
what is the command to check process ids , which are running from long time and which are consuming more cpu?
Also how to check, what a particular PID is running what
For Ex:
i have a pid :3223722 which is running since from long time,
if i want to check what is this... (1 Reply)
Discussion started by: sidharthmellam
1 Replies
7. UNIX for Dummies Questions & Answers
Hello all:
Working on a job I was asked get a simple script to perform the following task and would like to ask for some help. I'm looking forward to learning more and diving deeper into the World of Open Source servers.
I need a script for a Unix server, using as few lines as possible, that... (4 Replies)
Discussion started by: moahten
4 Replies
8. Shell Programming and Scripting
Hi all,
I need a script that will loop around all the current processes and take a pmap -x <process id> and output each pmap to a separate file.
Would anyone have a quick command to do this? (2 Replies)
Discussion started by: borderblaster
2 Replies
9. Programming
I am facing a strange error while creating posix threads:
Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output.
Snippet 1
This works:
--------------
int *threadids;
threadids = (int *) malloc (num_threads * sizeof(int));
... (4 Replies)
Discussion started by: kmehta
4 Replies
10. UNIX for Advanced & Expert Users
Hello All,
I need to track the exact process ID related to a particular application running on HP-UX machine. i.e. the exact functionality of fuser unix command.
fuser application.log // It gives the exact process ID for application.log
Since there is no provision for 'fuser' in HP-UX... (13 Replies)
Discussion started by: abhishek0071
13 Replies
SETRESUID(2) BSD System Calls Manual SETRESUID(2)
NAME
getresgid, getresuid, setresgid, setresuid -- get or set real, effective and saved user or group ID
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
int
getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
int
getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
int
setresgid(gid_t rgid, gid_t egid, gid_t sgid);
int
setresuid(uid_t ruid, uid_t euid, uid_t suid);
DESCRIPTION
The setresuid() system call sets the real, effective and saved user IDs of the current process. The analogous setresgid() sets the real,
effective and saved group IDs.
Privileged processes may set these IDs to arbitrary values. Unprivileged processes are restricted in that each of the new IDs must match one
of the current IDs.
Passing -1 as an argument causes the corresponding value to remain unchanged.
The getresgid() and getresuid() calls retrieve the real, effective, and saved group and user IDs of the current process, respectively.
RETURN VALUES
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the
error.
ERRORS
[EPERM] The calling process was not privileged and tried to change one or more IDs to a value which was not the current real ID,
the current effective ID nor the current saved ID.
[EFAULT] An address passed to getresgid() or getresuid() was invalid.
SEE ALSO
getegid(2), geteuid(2), getgid(2), getuid(2), issetugid(2), setgid(2), setregid(2), setreuid(2), setuid(2)
HISTORY
These functions first appeared in HP-UX.
BSD
February 7, 2015 BSD