- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: background to foreground
Categories
Company
Local Language
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 05:01 PM
06-10-2004 05:01 PM
I have two process running in a back ground. I am using /sbin/sh shell. I am getting the process status with ps command. How to invoke the process into foregroud.
I am getting ps with -aef option to know the status. How to get the job id of that process and use on fg command on /sbin/sh shell.
Thanks,
Muthukumar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 05:09 PM - last edited on 09-16-2024 02:22 AM by support_s
06-10-2004 05:09 PM - last edited on 09-16-2024 02:22 AM by support_s
Re: background to foreground
- Tags:
- drive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 05:11 PM
06-10-2004 05:11 PM
Re: background to foreground
then fg jobNumber
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 05:13 PM
06-10-2004 05:13 PM
Re: background to foreground
# netscape
(Ctrl-Z)
prompt returns
# jobs
[1] netscape
# fg 1
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 05:43 PM
06-10-2004 05:43 PM
Re: background to foreground
Thanks for the reply.
jobs command not working for the requirement when the setup as,
node 1 <--> node 2
There is a sample script in node 2
----- test.ksh ----
#!/usr/bin/ksh
set -x
echo $hostname
sleep 10
echo $whoami
sleep 10
echo test over
#chmod +x test.ksh
remote execution from node 1 to node 2 happends as like
remsh node2 -l root -n "location/test.ksh 1>&- 2>&- &"
On node2,
I am seeing the process running with ps. But jobs are not displaying anything about that.
How to do the invokation of remotely started process in background to foregroud"?
Thanks,
Muthukumar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 06:09 PM
06-10-2004 06:09 PM
Re: background to foreground
Get the PID using ps -ef and bring the process into foreground using
fg PID
regards,
RDL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 06:26 PM
06-10-2004 06:26 PM
Re: background to foreground
I collected the node2's process with ps as
#ps -ef | grep -v grep | grep test.ksh
root 545 543 0 18:35:21 ? 0:18 /usr/bin/ksh test.ksh
root 543 540 0 18:35:21 ? 0:00 sh -c test.ksh
# fg 545
sh: fg: The specified job does not exist.
# fg 543
sh: fg: The specified job does not exist.
# jobs
It is not showing anything.
What is the problem.
It was started at 18:35:21 but now 20:23:55.
Process started as same script after that in background had completed.
Thanks,
Muthukumar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 06:32 PM
06-10-2004 06:32 PM
Re: background to foreground
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 06:53 PM
06-10-2004 06:53 PM
Re: background to foreground
You are correct.
Process status as
#ps -aef | grep -v grep | grep test.ksh
root 545 543 0 18:35:21 ? 0:22 /usr/bin/ksh test.ksh
root 543 540 0 18:35:21 ? 0:00 sh -c
#ps -aef | grep -v grep | grep 540
root 540 849 0 18:35:21 ? 0:02 remshd
root 543 540 0 18:35:21 ? 0:00 sh -c test.ksh
#ps -aef | grep -v grep | grep 849
root 849 1 0 May 20 ? 1:19 /usr/sbin/inetd
root 540 849 0 18:35:21 ? 0:02 remshd
So after the remote execution with 1>&- 2>&- &,the process will be executing alone.
During the stress test (around 100 process), some process 4-8 process are not progress it's execution.
How to check weather the background process are doing the execution or not?
Thanks,
Muthukumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2004 07:06 PM
06-10-2004 07:06 PM
Solutioni suppose you could do a process tree and see if what command the process is executing, and hopefully be able to tell what the process is blocked on. glance could be helpful for doing this.
you also could rewrite your script to output some progress info to a log file.