linux - Explanation about multiple su -
i'm bit confused when multiple su happen. lets situation happen:
fikrie su root : ps -ef | grep su: root 15524 15388 0 10:15 pts/0 00:00:00 su root
i know pid su 15524 , parent pid 15388. when multiple su happen. eg : situation.
fikrie su root: root su fikrie2: fikrie 2 su root: ps -ef | grep su: root 15450 15388 0 10:15 pts/0 00:00:00 su root fikrie2 15468 15458 0 10:15 pts/0 00:00:00 su fikrie2 root 15478 15476 0 10:15 pts/0 00:00:00 su root
i thought when root su fikrie2, first pid ppid second su. somehow when tried grep process, confuses me. ppid became 15458
instead of 15450
or 15388
. none of ppid connected/related ppid or pid before it. tried google , read process relationship
in advanced programming in unix environment
book. can give me explanation or maybe link me understand more on process relationship.
i'm trying write code find user su user. answer so, find original user, eg. fikrie. if second situation happen, wasn't able fikrie2 when su root fikrie2. instead fikrie original user. original idea use parent id user, when doing command line. confuse me.
ps* i'm trying on unix platform. not know windows, if ppid , pid different between windows , unix, please point me direction unix.
i'm not sure, suspect parent process seeing shell got called. when su run .profile call multiple other processes , end shell being launched. parent process isn't going previous invocation of su, because isn't process spawned one. shell did that.
Comments
Post a Comment