Hi Gurus
I have a process that starts as root then changes to nobody.
Its on a headless Arm5 pogoplug, and everything is running as root.
so it cant use mailx, and strangely login to a remote site.
I can get the PID, but I cant find anywhere an example of how to use setuid or set setgid to change the owner of the running process to root, so that if I :-
what I want to get is
I'm stuck on the syntax for
setuid root > PID of process
can someone help please
TIA
Richard
The setgid and setuid bits work fine, but you must compile the command with -R (well, some option that says find dynamic libs by the compile-time dynamic library full paths, only) or entirely static linked, as the environment is cleared of $PATH and $LD_LIBRARY_PATH when changing IDs. This also tends to mess up all script interpreters, even if your script starts with a good #! line and has execute permissions and immediately resets environment. I would expect it is described in the exec() man pages. Man Page for execvp (opensolaris Section 2) - The UNIX and Linux ForumsMan Page for setuid (opensolaris Section 2) - The UNIX and Linux Forums
I understand you start it as root but it switches to nobody by means of setuid() and seteuid() calls.
I think you cannot undo that; there is no setuid that works on other processes, and a change of the user in /proc will fail.
Well, I suppose you could code setuid(0) but how to get permission to re-enter root? I guess if you are still uid root, you should be able to change euid back. Otherwise, you need to exec a setuid executable to get the proc back to root.
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)
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)
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... (0 Replies)
Dear all,
I wonder if it is possible that we can run the script
from time to time..I meant, it should repeat the
sourcing of the script by itself? In my case, I need
to source this script manually from time to time,
like once in every 10 minutes.
emily, (2 Replies)
I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
I have been having some trouble trying to get some code working, so I was wondering...what system calls are required to execute a different program from an already running process? (1 Reply)
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 Everybody,
I want to create a shell script named as say "jip" and it is runned.
And i want that when i do ps + grep for the process than this jip should be shown as process.
Infact there might be process with name jip which is already running. (3 Replies)
I need to write a shell script which would take 2 arguments pid , userid. Then it should kill all the child process under it. If a child process is not killed then it should wait for 1 minute and should kill.
can anybody give me the idea to write it? (0 Replies)