I wrote a script as Ubuntu startup service (that located at /etc/init.d and run at startup) There is a line
HOMEDIR=`getent passwd username1 | cut -d: -f6`
The problem is, when I run the script in shell, being logged as username1 or even root, the command returns
/home/username1
When the script is run on boot, the command returns nothing. Why that happens? Maybe, the user (or super one) does not have access to the /usr/bin/passwd file?
UPDATE: The problem is username1 is stored in remote server, so LDAP loads it while boot. When the command, referred to above, executes, LDAP status is activating (start) but not active (running). It seems to be that since it is not started completely, so username1 account is not loaded to the host system.
Still I failed to decide problem, now I'm trying, any help/hints appreciated.