/usr/local/directadmin/scripts/setup.txt: No such file or directory

igor-moonlite

New member
Joined
Dec 8, 2022
Messages
3
Hello,

Fresh installation on Debian 11. Everything goes well, but then the installation gets aborted:

Code:
Checking quotas...
Running quotacheck
done
Done quotacheck
grep: /usr/local/directadmin/scripts/setup.txt: No such file or directory
Welcome to DirectAdmin version 1.645!

creating base main directory layout: creating diradmin system user: exec: "useradd": executable file not found in $PATH:

I've uploaded the complete console output at: https://pastebin.com/9ng5uLVC

We have another installation deployed about 3 months ago, on Debian 11 as well, and didn't have such issues.

I'd appreciate any help.

--
Regards,
Igor
 
Hi, could you please show us the output of the following commands executed on the server where installation has failed:

Code:
# echo $PATH   
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Code:
# dpkg-query -l passwd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=============================================
ii  passwd         1:4.8.1-1    amd64        change and administer password and group data

Code:
# stat /usr/sbin/useradd
  File: /usr/sbin/useradd
  Size: 142872        Blocks: 280        IO Block: 4096   regular file
Device: 45h/69d    Inode: 2151627234  Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-02-07 14:54:14.000000000 +0000
Modify: 2020-02-07 14:54:14.000000000 +0000
Change: 2022-11-24 20:45:33.005807537 +0000
 Birth: 2022-11-24 20:45:33.005807537 +0000

Commands here shows example output from a default Debian 11 system.
 
Hello and thank you for your response. Here's the output:

Code:
# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

Code:
# dpkg-query -l passwd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=============================================
ii  passwd         1:4.8.1-1    amd64        change and administer password and group data

Code:
# stat /usr/sbin/useradd
  File: /usr/sbin/useradd
  Size: 142872          Blocks: 280        IO Block: 4096   regular file
Device: 801h/2049d      Inode: 261229      Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-12-08 12:35:06.624119693 +0300
Modify: 2020-02-07 17:54:14.000000000 +0300
Change: 2022-12-08 12:34:53.788119476 +0300
 Birth: 2022-12-08 12:34:53.328119469 +0300

I'd also add that we have no problem using a different distro, if there may be an issue with Debian 11.

Thanks.
 
Thanks, everything seems ok with your Debian 11 distro, however it is strange that your root account does not have /usr/sbin directory set in the PATH environment variable. On default Debian 11 installations /etc/profile ensures root account has /usr/sbin in PATH:

Code:
# cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$(id -u)" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH
...

Maybe you have customized the /etc/profile file or you have PATH replaced by any other scripts that are sourced at login shell start time.

The best way to fix it would be to find why and where PATH got replaced. If you continue using the system without fixing this you will run in all kinds of problems for the root account. In this case DA installation failure is an early sign of potential problems in the future.

This is the list of files that gets read and executed when starting a new shell session on a default Debian 11 server:
  • /etc/profile
  • /etc/bash.bashrc
  • /etc/profile.d/*
  • /root/.profile
  • /root/.bashrc
Checking these files might help you find why on root account you have PATH set to a value that is usually used for non-root accounts.

If you opt to ignore this issue you can fix PATH variable just for the installer with manually adjusting the PATH variable before starting the installer:

Code:
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
bash <(curl -fsSL https://download.directadmin.com/setup.sh) 'license-key'

This will temporary fix the PATH variable but the problem will persist and you are likely to not run into problems later as well.
 
Thanks. It looks like the issue was caused by the fact that I logged onto the server via SSH as a non-root user and then did "su" to get superuser access. After allowing ssh access for root user, I was able to complete the installation.

So it looks like this can be closed. Thanks again!
 
Thanks for clarification. (y) for quickly finding the main cause of the issue and sharing with everyone.

Yes using plain su command will not update PATH variable accordingly. For privilege elevation it is recommended to use su -l. Argument -l makes sure to start a login shell with a clean environment. Without -l you end up with a hybrid environment where some variables refer to the original user rather than root. For example echo $USER would print your original username if su was called without -l.
 
Back
Top