'su --login user -c command' doesn't run loggin scripts

'su --login user -c command' doesn't run loggin scripts

Post by Ernest Chiarell » Sun, 31 Dec 1899 09:00:00

hello, i have a Mandrake 7.0

'su --login user -c command' doesn't run loggin scripts

it does not read the .bash_profile !

Wed Feb 16 15:50:35 CET 2000


total 24
drwxr-xr-x   2 postgres postgres     4096 Feb 16 15:50 ./
drwxr-xr-x  13 root     root         4096 Feb 16 15:48 ../
-rw-------   1 postgres postgres     1568 Feb 16 11:49 .bash_history
-rw-r--r--   1 postgres postgres      177 Feb 16 11:49 .bash_profile
-rw-r--r--   1 postgres postgres      177 Feb 15 17:32 .bashrc

this works fine on redhat 6.

Wed Feb 16 16:06:43 CET 2000


total 45
drwxr-xr-x  20 postgres postgres     1024 Feb 16 16:06 .
-rw-r--r--   1 postgres postgres      256 Feb 16 16:06 .bash_profile
-rw-r--r--   1 postgres postgres     1448 Feb 16 16:06 .bashrc
drwxr-xr-x  32 root     root         1024 Feb 16 15:00 ..
-rw-------   1 postgres postgres    14343 Feb 16 10:39 .bash_history

is it a bug or a feature ?



1. 'last' command doesn't show complete login times

I am trying to use the information from the "last" command to examine
how long users are logged into a certain machine for a research
project.  I wrote a perl script to parse the information into a comma
delimited file, opened it in a spreadsheet, and sorted the entries by
how long the users were logged in.  To my surprise, out of about 3200
entries, only 17 of them showed up as being logged in for more than an
hour!  I know this information is inaccurate, because these users work
on projects for hours at a time.  Another mystery is that when I run
"who", it shows about 50 users being logged in, whereas the "last"
command only shows about 10.  Running last using utmpx as the file
instead of the default wtmpx, it shows users being logged in for a lot
longer. (???)

I know that the "who" command uses the utmpx file, and the "last"
command uses the wtmpx file, but shouldn't the wtmpx file contain the
same information as the utmpx file, only a lot more of it?  Can anyone
think of an explanation to why the "last" output isn't showing the
entire session a user is logged in for?  Also, if there is data
missing, is there another way I can get the login and logout history
of all the users?

I would greatly appreciate any help you can give. :)


2. What's the kernel nfs* for?

3. What is the difference between 'login: root' and 'su -' ?

4. Reading audio from Panasonic CD

5. TIS Firewall Toolkit and screend on FreeBSD?

6. 'su ' vs. 'su -'

7. Gawk difficulties

8. restrict use of 'su' or 'su -'

9. MD5 disabled the 'su' and 'logon' command

10. 'failed running login shell' no non-root user login possible

11. Help with 'user', 'w', 'who' commands

12. expect script doesn't understand '$1' from command line?