Operating System - Linux
1754058 Members
5691 Online
108811 Solutions
New Discussion юеВ

Linux - How to trace login procedure

 
Raynald Boucher
Super Advisor

Linux - How to trace login procedure

Hello all,

I'm experimenting a problem with the login procedure for a user.
When I log on interactively as user Joe on a Linux server, his environment (ie work, home log and temp directories) is set properly and the subject job executes properly.
When I submit the same job from an Autosys server, the job fails due mostly to an incorrect environment (generating infut file not found).

I have modified the job to display userid and all system variables but that only provides the end result and not how/why the error happened.

I try modifying /etc/profile to use "set -x" and "script" to an output file but that only gave me a zero length log.

How can I trace the logon process?
I mean see which login scripts were executed and a detail log of each command?

Thanks
Rayb
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: Linux - How to trace login procedure

Shalom Rayb,

Two ideas.

set -x in the .bash_profile or whatever is being executed. env > file in the profile or startup script.

At login, find out the process id and use strace to track the process in detail. See the man page for strace to see about hanging it on a process in a script.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ivan Ferreira
Honored Contributor

Re: Linux - How to trace login procedure

Try modifying the job to source the /etc/profile, the .bashrc and .bash_profile files, for example:

source /etc/profile
source ~/.bash_profile
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Marco A.
Esteemed Contributor

Re: Linux - How to trace login procedure

You can start your "session" and then try to login that user, then use the tusc application to trace what is doing ...
#tusc

Try that and let us know your results.

Best regards,

Marc0
Just unplug and plug in again ....