Sponsored Content
Top Forums Shell Programming and Scripting facing problem in starting a process in background using shell script. Post 302185454 by era on Tuesday 15th of April 2008 03:33:22 AM
Old 04-15-2008
Yes, somebody has ever tried to start a process in the background. The problem is, it will foreground if it requires tty input. An interactive shell will thus foreground when it wants to read input. If you disable that, you can run it in the background just fine.

Code:
sh </dev/null &

(It finishes pretty quickly because it has nothing to do, though. :^)

Servers usually have their own start-up scripts which often require root privileges. Depending on your architecture, look for something like /etc/init.d/tomcat (for a Debian-type system) or /etc/rc/tomcat or some such.
 

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. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies

3. Shell Programming and Scripting

Background Process Shell Scripting

I have a following program: echofunc() { filename=$1 echo "reading $filename" while read line do echo $line; sleep 6; done < $filename } split -5 new.dat ls x* > input.dat while read file do echofun $file & done < input.dat (3 Replies)
Discussion started by: dhieraj
3 Replies

4. UNIX for Advanced & Expert Users

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 ... (2 Replies)
Discussion started by: asalman.qazi
2 Replies

5. Shell Programming and Scripting

Creating background process for my shell

I actually posted this problem on a different forum, but figured this would be a more appropriate place to post it. OK so I've created my own shell, but I can't get the background process function to run properly! What I want to do is to run a process in the background, and also print when the... (2 Replies)
Discussion started by: hansel13
2 Replies

6. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

7. Shell Programming and Scripting

Problem facing command using shell

Dear Brothers! Need your help for the case where I am running one command on prompt and its giving us the correct output, but when i use the same command from shell its directs no output.:wall: the command on command prompt is ls -ltrh * | nawk '{if ($5~ '/$'M'/') print $9}' | grep -v... (1 Reply)
Discussion started by: jojo123
1 Replies

8. Shell Programming and Scripting

Running Shell Script in the cron, background process

Hi, i was looking for an answer for some trouble im having runing a script in the cron, thing is, that when i run it manually it works just fine. But when cron runs it, it just doenst work. I saw a reply on a similar subject, suggesting that the . .profile worked for you, but im kind of... (9 Replies)
Discussion started by: blacksteel1988
9 Replies

9. Shell Programming and Scripting

Facing problem in the sqlldr & shell script

Guys i am facing two problems : (1) when i create the sql loader file the date format i m getting is this 28-DEC-11 12.03.14.107137 AM; for this i m using this script but unable to load the files trailing nullcols ( SERIALNO, AMOUNT, CLASS, MDN, VDATE "to_date(:TIMESTAMP, 'DD-MON-YY... (6 Replies)
Discussion started by: xal_kaushi
6 Replies

10. Shell Programming and Scripting

Facing problem with Alias created through script.

Hi Guru's, I am creating alias for db instance running on a server through script, am able to create them based on /etc/oratab entries and can use successfully with the below script. #!/bin/bash SCRIPT_PATH=${HOME}/scripts/db/script... (3 Replies)
Discussion started by: venky.b5
3 Replies
XSetState(3X11) 						     MIT X11R4							   XSetState(3X11)

Name
       XSetState, XSetFunction, XSetPlanemask, XSetForeground, XSetBackground - GC convenience routines

Syntax
       XSetState(display, gc, foreground, background, function, plane_mask)
	  Display *display;
	  GC gc;
	  unsigned long foreground, background;
	  int function;
	  unsigned long plane_mask;

       XSetFunction(display, gc, function)
	  Display *display;
	  GC gc;
	  int function;

       XSetPlaneMask(display, gc, plane_mask)
	  Display *display;
	  GC gc;
	  unsigned long plane_mask;

       XSetForeground(display, gc, foreground)
	  Display *display;
	  GC gc;
	  unsigned long foreground;

       XSetBackground(display, gc, background)
	  Display *display;
	  GC gc;
	  unsigned long background;

Arguments
       background
		 Specifies the background you want to set for the specified GC.

       display	 Specifies the connection to the X server.

       foreground
		 Specifies the foreground you want to set for the specified GC.

       function  Specifies the function you want to set for the specified GC.

       gc	 Specifies the GC.

       plane_mask
		 Specifies the plane mask.

Description
       The function sets the foreground, background, plane mask, and function components for the specified GC.

       can generate and errors.

       sets a specified value in the specified GC.

       can generate and errors.

       The function sets the plane mask in the specified GC.

       can generate and errors.

       The function sets the foreground in the specified GC.

       can generate and errors.

       The function sets the background in the specified GC.

       can generate and errors.

Diagnostics
       The server failed to allocate the requested resource or server memory.

       A value for a GContext argument does not name a defined GContext.

       Some numeric value falls outside the range of values accepted by the request.
		 Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument
		 defined as a set of alternatives can generate this error.

See Also
       XCreateGC(3X11), XQueryBestSize(3X11), XSetArcMode(3X11), XSetClipOrigin(3X11), XSetFillStyle(3X11), XSetFont(3X11), XSetLineAt-
       tributes(3X11), XSetTile(3X11)
       X Window System: The Complete Reference, Second Edition, Robert W. Scheifler and James Gettys

																   XSetState(3X11)
All times are GMT -4. The time now is 04:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy