Tiny Core Linux
Tiny Core Extensions => TCE Bugs => Topic started by: Kingdomcome on November 21, 2009, 10:50:08 AM
-
The startup script for pcmanfm is hardcoded with the user tc. It would be nice for it to read the username from /etc/sysconfig/tcuser.
-
The startup script for pcmanfm is hardcoded with the user tc. It would be nice for it to read the username from /etc/sysconfig/tcuser.
I see your point, however it is not so trivial. Startup script is executed before saved data restored ant it may overwrite /etc/sysconfig/tcuser
Also if there is a different user specified it is required to check /etc/passwd to check user exists, its home directory setting, etc. I would postpone it for a later time.
What is more trivial to add it to /root
To be honest it is not a pcmanfm business, more it is up to the gtk+ environment. It is done by pcmanfm and wicd only to fix its lack and to make them working >:( as a victim. Possibly other applications are missing it also.
-
What I do in any script that reads or writes to home, or needs to run an app as the default user is:
#!/bin/sh
tcuser=$(cat /etc/sysconfig/tcuser)
cp -p /some/file /home/${tcuser}/file
sudo -u ${tcuser} somecommand
I see this in other extensions and believe this is somewhat of a TC standard, it allows people to use the "user=" bootcode.
-
/etc/sysconfig/tcuser should never be overwritten by a startup script or a backup. It is there to be referred to to find the current user. The bootcode should be used to specify user and not by backing up /etc/sysconfig/tcuser. This approach should be used when copying files to the home directory:
#!/bin/sh
MYUSER=`cat /etc/sysconfig/tcuser
cp file /home/"$MYUSER"/
And not using /home/tc as the home directory.
EDIT: I see Kingdomcome has just posted the same, and it is the right approach.
-
The probmlem with your script that it expets to have user's home directory in /home which is not necessarily true, as user's home can be anywhere. Exact location is stored normally in /etc/passwd and this is used by other utilities.
Well, you can establish a rule for TC that a user home dir must be in /home, but this would be an unnecsary restriction.
-
Tce-setup expects and makes the user's home directory in /home/`cat /etc/sysconfig/tcuser`. So unless that is changed, /home is always where the user home directory is.
-
The probmlem with your script that it expets to have user's home directory in /home which is not necessarily true, as user's home can be anywhere. Exact location is stored normally in /etc/passwd and this is used by other utilities.
Well, you can establish a rule for TC that a user home dir must be in /home, but this would be an unnecsary restriction.
Sure, but on the other hand having just this extra "feature" could be considered excessive. As already pointed out, TC already uses /home... it's a standard anyways, and it could be said that probably all user home directories will be in /home.
But if this realllly bothering you, you could do something likesu -c 'echo $HOME' `cat /etc/sysconfig/tcuser`
-
I'm fine with this limitation or call it rule :) on TC. I asked it because in general under LINUX you can put user's home anywhere, using /home is not a technical requirement but simplyfies administration and offers some standard compatibility.
-
convention seems to fit the bill
I'd say it's similar to any other path. In a Linux based distro, you could change anything. Why /etc/passwd? Or /usr/bin? /root? etc...
-
convention seems to fit the bill
Why /etc/passwd? Or /usr/bin? /root? etc...
Linux Standard Base (LSB) ? http://www.linuxfoundation.org/collaborate/workgroups/lsb
-
Sure, and those are conventions :)
(side note: I seem to recall FHS saying /home was optional)
... and this is getting OT heh. Need a split?
-
... and this is getting OT heh. Need a split?
Do not split, I do not want to deal with this topic now :D