- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- "su - {user}" within an init.d script usage - exte...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
12-15-2003 05:50 AM
12-15-2003 05:50 AM
"su - {user}" within an init.d script usage - extended shutdown and startup times
I'm troubleshooting an issue we have on a number of HPUX 11.x boxes, where the shutdown and startup times are VERY long, due to the display scrolling lines and lines upon lines of '.' characters for each subsystem in the checklist, between the name and the 'OK/FAIL' message.
In searching here, I've found what I believe is the culprit - we have perhaps 3 or 4 init.d scripts that contain lines to 'su -' to another user and run a command/script. At least that's responsible for the "not a typewriter" messages and so forth. One thing I did notice upon shutdown, is a message from init/rc saying "unable to get row and column info from screen".
I've modified the /etc/profile and /etc/csh.login (users in question have varied shells assigned) to account for interactive or non-interactive execution (Thanks Bill! Great tips in another thread), but cannot restart these boxen until the next maintenance window.
My question is - is it possible that these scripts (prior to my mods) could be responsible for the screen activity I'm seeing? The behavior seems to point to a terminal setting mismatch (I've toyed with the console emulation setting to no avail). I'm wondering if the profile/csh.login attempts to detect and set the TERM setting are causing all these dots. I've even set list_mode to 1, hoping that an abbreviated checklist would be displayed, to no avail.
I've considered editing the rc.utils and taking the MAX_ROW and MAX_COL down to something smaller, but that seems pointless as I'm sure that file will get updated at the next upgrade.
Any pointers? Am I on the right track? I'm hopeful that my changes will be successful (won't know until next Sunday).
Thanks gang!!!
-Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 05:54 AM
12-15-2003 05:54 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
Start up and shutdown also depends upon the server.
Examples of my servers
N Class 6 way 6 Gig complete reboot 9.5 mins
K Class 4 way 6 gig 35 mins.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 05:56 AM
12-15-2003 05:56 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:01 AM
12-15-2003 06:01 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
For all those scripts you can redirect the output to a file and avoid messages on screen.
something like.
script > /tmp/se.log 2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:06 AM
12-15-2003 06:06 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
Can you post dmesg?
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:17 AM
12-15-2003 06:17 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
Years ago I was troubleshooting a similar issue and when I placed a support call to HP, I was told the dots are just the to let you know that the system is not hung, but executing the a script. My issue was that a system resource (file system) wasn't available when the script was called. Simply moving the start # (S991foo) later, and to rc3 fixed my issue. After that, the script only 'dotted' for a few seconds, and then continues down the rc script list and we were up.
Do the scripts in question work quickly when run after the system is already up ?
HTH, and Good Luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:21 AM
12-15-2003 06:21 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
# dmesg
Dec 15 14:20
...
10/0/0.97.35.19.0.9.4 sdisk
11/0/10/0/0.97.35.19.0.9.5 sdisk
11/0/10/0/0.97.35.19.0.9.6 sdisk
11/0/10/0/0.97.35.19.0.9.7 sdisk
11/0/10/0/0.97.35.19.0.10 tgt
11/0/10/0/0.97.35.19.0.10.0 sdisk
11/0/10/0/0.97.35.19.0.10.1 sdisk
11/0/10/0/0.97.35.19.0.10.2 sdisk
11/0/10/0/0.97.35.19.0.10.3 sdisk
11/0/10/0/0.97.35.19.0.10.4 sdisk
11/0/10/0/0.97.35.19.0.10.5 sdisk
11/0/10/0/0.97.35.19.0.10.6 sdisk
11/0/10/0/0.97.35.19.0.10.7 sdisk
11/0/10/0/0.97.35.19.0.11 tgt
11/0/10/0/0.97.35.19.0.11.0 sdisk
11/0/10/0/0.97.35.19.0.11.1 sdisk
11/0/10/0/0.97.35.19.0.11.2 sdisk
11/0/10/0/0.97.35.19.0.11.3 sdisk
11/0/10/0/0.97.35.19.0.11.4 sdisk
11/0/10/0/0.97.35.19.0.11.5 sdisk
11/0/10/0/0.97.35.19.0.11.6 sdisk
11/0/10/0/0.97.35.19.0.11.7 sdisk
11/0/10/0/0.97.35.19.0.12 tgt
11/0/10/0/0.97.35.19.0.12.0 sdisk
11/0/10/0/0.97.35.19.0.12.1 sdisk
11/0/10/0/0.97.35.19.0.12.2 sdisk
11/0/10/0/0.97.35.19.0.12.3 sdisk
11/0/10/0/0.97.35.19.0.12.4 sdisk
11/0/10/0/0.97.35.19.0.13 tgt
11/0/10/0/0.97.35.19.0.13.0 sdisk
11/0/10/0/0.97.35.19.0.13.1 sdisk
11/0/10/0/0.97.35.19.0.13.2 sdisk
11/0/10/0/0.97.35.19.0.13.3 sdisk
11/0/10/0/0.97.35.19.0.13.4 sdisk
11/0/10/0/0.97.35.19.0.13.5 sdisk
11/0/10/0/0.97.35.19.0.13.6 sdisk
11/0/10/0/0.97.35.19.0.13.7 sdisk
11/0/10/0/0.97.35.19.0.14 tgt
11/0/10/0/0.97.35.19.0.14.0 sdisk
11/0/10/0/0.97.35.19.0.14.1 sdisk
11/0/10/0/0.97.35.19.0.14.2 sdisk
11/0/10/0/0.97.35.19.0.14.3 sdisk
11/0/10/0/0.97.35.19.0.14.4 sdisk
11/0/10/0/0.97.35.19.0.14.5 sdisk
11/0/10/0/0.97.35.19.0.14.6 sdisk
11/0/10/0/0.97.35.19.0.14.7 sdisk
11/0/10/0/0.97.35.19.0.15 tgt
11/0/10/0/0.97.35.19.0.15.3 sdisk
11/0/10/0/0.97.35.19.0.15.4 sdisk
11/0/10/0/0.97.35.19.0.15.5 sdisk
11/0/10/0/0.97.35.19.0.15.6 sdisk
11/0/10/0/0.97.35.19.0.15.7 sdisk
11/0/10/0/0.97.35.19.1 fcparray
11/0/10/0/0.97.35.19.1.0 tgt
11/0/10/0/0.97.35.19.1.0.0 sdisk
11/0/10/0/0.97.35.19.1.0.1 sdisk
11/0/10/0/0.97.35.19.1.0.2 sdisk
11/0/10/0/0.97.35.19.1.0.3 sdisk
11/0/10/0/0.97.35.19.1.0.4 sdisk
11/0/10/0/0.97.35.19.1.0.5 sdisk
11/0/10/0/0.97.35.19.1.0.6 sdisk
11/0/10/0/0.97.35.19.1.0.7 sdisk
11/0/10/0/0.97.35.19.1.1 tgt
11/0/10/0/0.97.35.19.1.1.0 sdisk
11/0/10/0/0.97.35.19.1.1.1 sdisk
11/0/10/0/0.97.35.19.1.1.2 sdisk
11/0/10/0/0.97.35.19.1.1.3 sdisk
11/0/10/0/0.97.35.19.1.1.4 sdisk
11/0/10/0/0.97.35.19.1.1.5 sdisk
11/0/10/0/0.97.35.19.1.1.6 sdisk
11/0/10/0/0.97.35.19.1.1.7 sdisk
11/0/10/0/0.97.35.19.1.2 tgt
11/0/10/0/0.97.35.19.1.2.0 sdisk
11/0/10/0/0.97.35.19.1.2.1 sdisk
11/0/10/0/0.97.35.19.1.2.2 sdisk
11/0/10/0/0.97.35.19.1.2.3 sdisk
11/0/10/0/0.97.35.19.1.2.4 sdisk
11/0/10/0/0.97.35.255.1 fcpdev
11/0/10/0/0.97.35.255.1.3 tgt
11/0/10/0/0.97.35.255.1.3.0 sctl
11/0/11 lba
11/0/11/0/0 c720
11/0/11/0/0.1 tgt
11/0/11/0/0.1.0 sdisk
11/0/11/0/0.3 tgt
11/0/11/0/0.3.0 stape
11/0/11/0/0.7 tgt
11/0/11/0/0.7.0 sctl
11/0/12 lba
11/0/14 lba
11/5 memory
11/10 processor
11/11 processor
11/12 processor
11/13 processor
System Console is on the Built-In Serial Interface
btlan: Initializing 10/100BASE-TX card at 11/0/0/1/0....
btlan: Initializing 10/100BASE-TX card at 11/0/2/0/0....
btlan: Initializing 10/100BASE-TX card at 11/0/9/0/0....
Entering cifs_init...
Initialization finished successfully... slot is 9
Logical volume 64, 0x3 configured as ROOT
Logical volume 64, 0x2 configured as SWAP
Logical volume 64, 0x2 configured as DUMP
Swap device table: (start & size given in 512-byte blocks)
entry 0 - major is 64, minor is 0x2; start = 0, size = 12582912
Dump device table: (start & size given in 1-Kbyte blocks)
entry 0000000000000000 - major is 31, minor is 0x0; start = 514912, size = 6291456
Starting the STREAMS daemons-phase 1
Create STCP device files
Starting the STREAMS daemons-phase 2
$Revision: vmunix: vw: -proj selectors: CUPI80_BL2000_1108 -c 'Vw for CUPI80_BL2000_1108 build' -- cupi80_bl2000_1108 'CUPI80_BL2000_1108' Wed Nov 8 19:24:56 PST 2000 $
Memory Information:
physical page size = 4096 bytes, logical page size = 4096 bytes
Physical: 8380416 Kbytes, lockable: 6464672 Kbytes, available: 7425644 Kbytes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:25 AM
12-15-2003 06:25 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
The scripts in question start and stop databases and application services that do not provide their own startup and shutdown scripts.
These scripts run fine both interactively and non-interactively - but when run non-interactively via the startup/shutdown, I suspect their 'wacky' output is what's hosing up the display of the checklist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:26 AM
12-15-2003 06:26 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
That looks ok can you post rc.log
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:33 AM
12-15-2003 06:33 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
Usage: /sbin/rc3.d/S800patrol [start|stop]
Output from "/sbin/rc3.d/S800patrol start":
----------------------------
process not attached to terminal
Usage: who [-rbtpludAasHTqRm] [am i] [utmp_like_file]
r run level
b boot time
t time changes
p processes other than getty or users
l login processes
u useful information
d dead processes
A accounting information
a all (rbtpludA options)
s short form of who (no time since last output or pid)
H print header
T status of tty (+ writable, - not writable, x exclusive open, ? hung)
q quick who
R print host name
stty: : Not a typewriter
(c)Copyright 1983-2000 Hewlett-Packard Co., All Rights Reserved.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-1992 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1986 Digital Equipment Corp.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-2000 Mentat Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
(c)Copyright 1991-2000 Isogon Corporation, All Rights Reserved.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S. Government is subject to
restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.
Hewlett-Packard Company
3000 Hanover Street
Palo Alto, CA 94304 U.S.A.
Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
*******************************************************************************
* Unauthorized users are subject to prosecution *
* Use constitutes consent to security testing/monitoring *
*******************************************************************************
* Inactive sessions will be terminated after 30 minutes... *
*******************************************************************************
Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
.profile[30]: LANG: Parameter not set.
logout
cat: Cannot open /tmp/patrolagentstart.txt: No such file or directory
"/sbin/rc3.d/S800patrol start" FAILED
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:40 AM
12-15-2003 06:40 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
Check the environmental variables in the scrips, the error :-
Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
.profile[30]: LANG: Parameter not set.
logout
cat: Cannot open /tmp/patrolagentstart.txt: No such file or directory
"/sbin/rc3.d/S800patrol start" FAILED
The error comes from invoking 'stty' in an environment where stdin is not a terminal.
This error is normally seen when using the 'su - user -c command' form of 'su'.
The most appropriate way to eliminate the error is to conditionally call 'stty' -- something like:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=97479
Ensure that all commands have a full path to them.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:45 AM
12-15-2003 06:45 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
Correct. As I posted above, I've made the changes to the /etc/profile and /etc/csh.login (one scripts uses csh rather than sh) to determine whether or not scripts are being executed interactively. I won't be able to 100% test until my next maintenance window, however.
I used 'tty -s' and an if conditional to set a variable called INTERACTIVE, then depending on whether that variable is true or false, I've surrounded the terminal setup sections of the profile with a conditional as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 06:46 AM
12-15-2003 06:46 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
Sorry I should have said, it will take longer for the server to process multiple failures - hence the ................. as it is looking at each error and in many cases firing to the screen usage instructions.
Your rc.log will contain each error - I suggest you trawl through that and identify and fix each and every one, then check shutdown and startup times.
NB shutdown is trying to shutdown items that havent started.
Have fun.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 08:24 AM
12-15-2003 08:24 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
LIST_MODE=0
LIST_TIMEOUT=0
USE_COLOR=0
You should also ensure that the output from the start and stop segments (not start_msg and stop_msg) of all custom rc scripts, especially those using su -, are directed to stderr unless you want to see critical errors on the console. This can be safely done by putting 'exec >&2' at the begining of each segment. stderr is directed to /etc/rc.log through rc.
You did say that you are skipping terminal functions in the system profiles by way of tty -s testing, but have you also included the copyright, mail, news, etc?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2003 09:06 PM
12-16-2003 09:06 PM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
Is there a special reason why su - is used? I believe you should use su without the - option from within these scripts. You can always add any required variable assigments that were in the user's .profile into the script. That way you have the bits you need, without having all the terminal specific stuff.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2003 11:59 PM
12-16-2003 11:59 PM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
My solution is to redirect output from the 'su' command line to a file, rather than let it go to stderr and stdout. Seems to have cleared up my issue! It seems that anything that wrote to the screen caused this behavior. Strange.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 01:53 AM
12-17-2003 01:53 AM
Re: "su - {user}" within an init.d script usage - extended shutdown and startup times
su - bb -c "nohup /app/admin/bb/runbb.sh start /dev/null 2>&1" && echo bb started
Rgds...Geoff