Sponsored Content
Top Forums UNIX for Advanced & Expert Users problem starting a process on solaris from other user Post 302342363 by asalman.qazi on Sunday 9th of August 2009 06:42:30 AM
Old 08-09-2009
problem starting a process on solaris from other user

Hi Gurus,

I have a server that has to users.

1) root
2)net1

there are several processes running on my server

one of the process is CMIS_STACK process which is a compiled C code

when this process goes missing then i restart this process manually in the following manner



su net1(the process can only be started from net1 user)
cd /net1/bin
CMIS_STACK &


and the process starts successfully



now i have written a script that starts the process automatically if it goes missing

i have a process.txt file that contains all the important processes

ps -ax > process.txt
grep "CMIS_STACK" process.txt
if [ $? -ne 0 ]
then
date > error.log
echo "CMIS_STACK not running" >> error.log
su netmon
cd /net1/bin
CMIS_STACK &
echo "process startted successfully" >> error.log
fi


now if i run the above script , it exits without restarting the process. I am not able to figure out , what is the problem.

is this related to the swithching of the users in the script.

please Gurus help me out tosolve this problem Smilie


I have to implement this script as soon as possible

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capture the process id when starting a background process

Hello all, How do I start a background process and save the process id to a file on my system. For example %wait 5 & will execute and print the process id. I can't figure out how to get it to a file. I've tried: > filename 0>filename 1>filename. Any assistance is most appreciated. Thanks, Jim... (10 Replies)
Discussion started by: jleavitt
10 Replies

2. OS X (Apple)

process starting

Hello everybody! I got a question on process starting. I installed e.g. squid on my Mac and all is working well, but i wanted to figure out what process or script is starting squid on booting the machine. I searched for a while but i could not find where i can change these configuration. ... (2 Replies)
Discussion started by: count_zero
2 Replies

3. Solaris

Problem starting Sendmail on Solaris 9

Hi, I am getting problem in starting up Sendmail on solaris. When I do /etc/init.d/sendmail start in Process list it shows sendmail process properly. But when I do portcheck by netstat it doesn't show Port 25/smtp. What could be the problem ? Thanks NeeleshG (6 Replies)
Discussion started by: neel.gurjar
6 Replies

4. Shell Programming and Scripting

facing problem in starting a process in background using shell script.

hey all, i am working on sun solaris machine and i want to start a process in background using shell script (actually i wanna start tomcat server using shell script). please dont tell me that append a & at last because this is not working in the shell script. i have also used nohup and... (8 Replies)
Discussion started by: dtomar
8 Replies

5. Solaris

Solaris 8 logon problem with normal user

Hello. I have problem in Solaris 8. I can logon cde with root there is no problem. When I logon with normal user I am recieving black screen after 10 15 second login screen (cde pasword screen) coming again. 1 years ago we resolved same problem. We found a file It must be run with admin... (1 Reply)
Discussion started by: FATIH1453
1 Replies

6. UNIX for Dummies Questions & Answers

Starting a process whose ppid should be 1

How can I start a process with ppid as 1 instead of my current shell pid? (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

7. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

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)
Discussion started by: trey85stang
7 Replies

8. Solaris

Problem starting x11vnc on solaris 9

Hello, I installed x11vnc on a solaris 9 server. #SunOS gandalf 5.9 Generic sun4u sparc SUNW,Ultra-60 When i run x11vnc i get following errors bash-2.05# /usr/local/bin/x11vnc -display :0 17/06/2010 23:34:08 x11vnc version: 0.9.9 lastmod: 2009-12-21 pid: 16203 17/06/2010 23:34:15... (0 Replies)
Discussion started by: sunny_a_j
0 Replies

9. AIX

Changing process id after starting

Hi We are in the situation where we want to start WebSphere using teh default SSL port of 443. In order to do this we can changed the WAS ssl port from 9443 to 443 and start as root. We would prefer not to start as root but the restriction of using ports < 1024 comes into play. We could install... (3 Replies)
Discussion started by: hukcjv
3 Replies

10. UNIX for Beginners Questions & Answers

Solaris, grant user to kill another process

the task is grant user1 to kill another (for example user2) process. My steps: by root: usermod -P "Process Management" user1 login user1 user1@server (~) pfexec kill <PID> the result is: ksh: <PID>: not found or user1@server (~) pfexec pkill <PID> the result: nothing happens, still... (0 Replies)
Discussion started by: dsyberia
0 Replies
RENICE(8)						    BSD System Manager's Manual 						 RENICE(8)

NAME
renice -- alter priority of running processes SYNOPSIS
renice priority [[-p] pid ...] [[-g] pgrp ...] [[-u] user ...] renice -n increment [[-p] pid ...] [[-g] pgrp ...] [[-u] user ...] DESCRIPTION
The renice utility alters the scheduling priority of one or more running processes. The following who parameters are interpreted as process ID's, process group ID's, user ID's or user names. The renice'ing of a process group causes all processes in the process group to have their scheduling priority altered. The renice'ing of a user causes all processes owned by the user to have their scheduling priority altered. By default, the processes to be affected are specified by their process ID's. The following options are available: -g Force who parameters to be interpreted as process group ID's. -n Instead of changing the specified processes to the given priority, interpret the following argument as an increment to be applied to the current priority of each process. -u Force the who parameters to be interpreted as user names or user ID's. -p Reset the who interpretation to be (the default) process ID's. For example, renice +1 987 -u daemon root -p 32 would change the priority of process ID's 987 and 32, and all processes owned by users daemon and root. Users other than the super-user may only alter the priority of processes they own, and can only monotonically increase their ``nice value'' within the range 0 to PRIO_MAX (20). (This prevents overriding administrative fiats.) The super-user may alter the priority of any process and set the priority to any value in the range PRIO_MIN (-20) to PRIO_MAX. Useful priorities are: 20 (the affected processes will run at the lowest priority), 0 (the ``base'' scheduling priority), anything negative (lower values cause more favorable scheduling). FILES
/etc/passwd to map user names to user ID's SEE ALSO
nice(1), getpriority(2), setpriority(2) STANDARDS
The renice utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
The renice utility appeared in 4.0BSD. BUGS
Non super-users cannot increase scheduling priorities of their own processes, even if they were the ones that decreased the priorities in the first place. BSD
June 9, 1993 BSD
All times are GMT -4. The time now is 09:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy