- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to know which script is running at switch ...
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
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
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
10-26-2018 06:42 AM
10-26-2018 06:42 AM
how to know which script is running at switch user event
Help me out how to identify that which .ksh file runs during su - <username>
Because while i am switching as below:-
su - alp
There is script file which shows me some option to start stop application. I am sure this is .ksh file which is showing me the options to do operation with application like start , stop,reboot system, shut down aystem etc.
I am interested to know where is the file and how it is called by hp-ux at the time of 'su' command.
Thank you for the answer.
Regards,
Pardeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2018 12:26 PM
10-26-2018 12:26 PM
Re: how to know which script is running at switch user event
When doing an 'su - alp' the files that are run will depend on the shell for that user. If it is sh or ksh then the .kshrc and/or .profile will be run.
That would be the first place I would look. Those files likely call anything else that runs.
The other option is that instead of having /usr/bin/sh as the shell in /etc/passwd, the user may have a custom program or script as its "shell". If that is the case, then that script / program will run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2018 09:35 PM
10-26-2018 09:35 PM
Re: how to know which script is running at switch user event
I missed actually the command is
su - maint
I saw in .profile and .kshrc but both the file doesn't contain .ksh file related to program.
.kshrc_maint is the file which contain .ksh file calling command but i am not sure, is .kshrc_maint file called after ' su - maint' command.
A little input when i saw passwd file it is showing
maint:vxfrh98zgt2.c:210:201::/runex:/usr/bin/ksh
runex:tvx/9ytvidwc:212:201::/runex:/usr/bin/ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2018 08:03 PM
10-27-2018 08:03 PM
Re: how to know which script is running at switch user event
> maint:vxfrh98zgt2.c:210:201::/runex:/usr/bin/ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 09:14 PM
10-31-2018 09:14 PM
Re: how to know which script is running at switch user event
How can i check .kshrc_maint is executeding ?
Thank you for the guidance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2018 09:56 PM
11-01-2018 09:56 PM
Re: how to know which script is running at switch user event
> maint:vxfrh98zgt2.c:210:201::/runex:/usr/bin/ksh
I don't use ksh, so I know nothing, but I'd check the "man" page to
see if it automatically reads any files other than "~/.profile".
> I have checked ~maint/.profile but there is no calling related to
> .khrc_maint
Ok, but what if that ".profile" (or some other initialization script
fragment) runs something else which runs ".kshrc_maint"?
> How can i check .kshrc_maint is executeding ?
To see what "~/.profile" is doing, you could add "set -v" near its
beginning. If it's not obvious, then you might add a command like:
echo 'some message'
near the beginning of ".kshrc_maint".
There may be clever, modern methods to trace these things, but
simple, old methods like adding some "echo <message>" commands in
various places should help to locate interesting events.