DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

DirectAdmin script startips fails with an error c: command not found

| 15:38:59 09.12.2021

There is a typo in /usr/local/directadmin/scripts/startips which breaks the script:

The script defines:

DIRECTADMIN_BIN=/usr/local/directadmin/directadmin

but uses:

ADDIP=`${DABIN} c | grep -m1 '^addip=' | cut -d= -f2`

Which results in errors:

./startips: line 36: c: command not found
./startips: line 62: 2a01:7c8:xxx:xx:xx:xx:0:1: command not found
./startips: line 62: 37.xxx.xxx.115: command not found

and missing IPs on a network interface.

As a consequence NGINX might fail to start, dropping an error: 

bind() to [2a01:7c8:xxx:xx:xx:xx:0:1]:80 failed (99: Cannot assign requested address)

Suggested fix:

--- startips.org        2021-12-08 16:05:11.000000000 +0100
+++ startips    2021-12-09 10:37:03.392490622 +0100
@@ -30,14 +30,15 @@
        fi
 fi
+DIRECTADMIN_BIN=/usr/local/directadmin/directadmin
+DIRECTADMIN_CONF=/usr/local/directadmin/conf/directadmin.conf
+
 IPPATH="/usr/local/directadmin/data/admin/"
 IPDIR="ips/"
 IPLIST="ip.list"
-ADDIP=`${DABIN} c | grep -m1 '^addip=' | cut -d= -f2`
+ADDIP=`${DIRECTADMIN_BIN} c | grep -m1 '^addip=' | cut -d= -f2`
 OS=`uname`
-DIRECTADMIN_BIN=/usr/local/directadmin/directadmin
-DIRECTADMIN_CONF=/usr/local/directadmin/conf/directadmin.conf
 if [ -s $DIRECTADMIN_CONF ] && [ -x $DIRECTADMIN_BIN ]; then
         ETH_DEV=`$DIRECTADMIN_BIN c | grep '^ethernet_dev=' | cut -d= -f2`
 fi

It is a patch for /usr/local/directadmin/scripts/startips as a temporary solution, until DirectAdmin developers fix it on their side.

As an additional solution you might set:

net.ipv4.ip_nonlocal_bind = 1
net.ipv6.ip_nonlocal_bind = 1

with the sysctl tool.

Regards.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition