1855408 Members
3253 Online
104110 Solutions
New Discussion

funny background jobs?

 
kenken_3
Regular Advisor

funny background jobs?

Hi all,

I just encounter one funny problem when I am running background jobs at HP-UX11.0 workstations. The command I am using is: nohup sh script &. The simulation takes about 8 hours. I find out that:
1) when I run it from the console of the workstation, when I quit from the CDE, my background job will be tominated;

2) however, when I log in to the workstaion and telnet to other workstation and run the background at the other worksation, then I quit everything. My job will be still running at the other workstation?

Anyone know the reason and how to solve it?
wang & wang
4 REPLIES 4
Bill Hassell
Honored Contributor

Re: funny background jobs?

CDE is a strange environment. While clicking on a terminal window looks like a 'normal' telnet login, it isn't. You probably did not actually login and run the normal profiles. So I would start by turning on full profile logins for all terminals:

echo '*loginShell: true' >> $HOME/.Xdefaults

then logout from CDE and back in again. Now when you start a terminal window, you should see the 'normal' login messages.

Now start a background process as in:

nohup sleep 500 &

And from another telnet session, see that sleep's PPID is your your current shell (it will have - as in -sh if you make the above change to .Xdefaults). Now exit CDE and your telnet session should show sleep now has PPID 1 rather than a shell.



Bill Hassell, sysadmin
Omar Alvi_1
Super Advisor

Re: funny background jobs?

Hi,

Quite interesting.

Just wanted to know what effect the "*" has in,
echo '*loginShell: true' >> $HOME/.Xdefaults, and when is it used.

Thanx

-Alvi
Massimo Bianchi
Honored Contributor

Re: funny background jobs?

Hi,
honestly i don't know why,
but you need a stable platform to start your simulation, i suggest you two ways:

- schedule them with cron/at

- use screen (donwload at http://hpux.connect.org.uk/)

HTH,
Massimo
Bill Hassell
Honored Contributor

Re: funny background jobs?

.Xdefaults is an Xwindow resource file. When it exists in a user's HOME directory, the contents will be examined by Xwindow programs at startup and the settings applied, similar to a .profile when logging in. Xresources are listed in the man pages for most programs. For example, the resource loginShell is defined in hpterm, xterm and dtterm.

Without going into great detail about Xresources, a resource can be assigned to a specific program or window name as in:

HPterm*loginShell: true


In this case, the window's name restricts the loginShell setting to only HPterm windows. By leaving out the HPterm and leaving just *, then all windows will receive this resource setting. In HP-UX, only hpterm, xterm and dtterm do anything with this value. You can set specific terminal emulatorsto have a different geometry, screen size, colors, etc. Here is an example .Xdefaults file:

*loginShell: true
HPterm*scrollBar: true
HPterm*saveLines: 10s
HPterm*background: navy
HPterm*foreground: white
Xterm*background: darkslateblue
Xterm*foreground: white
Xterm*saveLines: 10s
Xterm*scrollBar: true
Dtterm*saveLines: 10s
Dtterm*scrollBar: true

It is important to note that Xwindow resource names are case sensitive...loginshell is not the same as loginShell (the former is just silently ignored).


Bill Hassell, sysadmin