csf not installed on clean install

aobh

Verified User
Joined
Feb 28, 2014
Messages
20
Hi,

Just setup a new clean Debian 11 VM. Installing DirectAdmin with an options.conf file. Part of that is

csf=yes

I see in the /usr/local/directadmin/custombuild the csf.tgz file and also a csf directory. However its not installed as a service.

Can somebody help me with this? I want to automate deployments with CSF installed.

Thanks!
 
How did you check the status? Did you check like this?

systemctl status csf

Or if you want, you can reinstall CSF again:

1) First remove all CSF installation:

systemctl disable csf.service
systemctl disable lfd.service
systemctl stop lfd.service
systemctl stop csf.service
rm -fv /usr/lib/systemd/system/csf.service
rm -fv /usr/lib/systemd/system/lfd.service
systemctl daemon-reload
rm -fv /etc/chkserv.d/lfd
rm -fv /usr/sbin/csf
rm -fv /usr/sbin/lfd
rm -fv /etc/cron.d/csf_update
rm -fv /etc/cron.d/lfd-cron
rm -fv /etc/cron.d/csf-cron
rm -Rfv /usr/local/directadmin/plugins/csf
rm -fv /etc/logrotate.d/lfd
rm -fv /usr/local/man/man1/csf.man.1
rm -Rfv /etc/csf /usr/local/csf /var/lib/csf
or

sh /etc/csf/uninstall.sh

2) Install CSF (old method):


or

cd /usr/local/directadmin/custombuild
./build csf

I have the same Operating System like yours. and CSF is running perfectly after I have done the above steps:

● csf.service - ConfigServer Firewall & Security - csf
Loaded: loaded (/lib/systemd/system/csf.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2022-11-30 00:34:03 +08; 35min ago
Process: 3721117 ExecStart=/usr/sbin/csf --initup (code=exited, status=0/SUCCESS)
Main PID: 3721117 (code=exited, status=0/SUCCESS)
CPU: 351ms
Nov 30 00:34:02 server.domain.com systemd[1]: Starting ConfigServer Firewall & Security - csf...
Nov 30 00:34:03 server.domain.com csf[3721117]: (restoring ipsets) (restoring iptables) (restoring ip6tables)
Nov 30 00:34:03 server.domain.com systemd[1]: Finished ConfigServer Firewall & Security - csf.

If you mean the service manager in DA GUI, then you have to add it in:

/usr/local/directadmin/data/admin/services.status
 
Last edited:
How did you check the status? Did you check like this?



Or if you want, you can reinstall CSF again:

1) First remove all CSF installation:


or



2) Install CSF (old method):



or



I have the same Operating System like yours. and CSF is running perfectly after I have done the above steps:



If you mean the service manager in DA GUI, then you have to add it in:
Thanks for the reply!

I get the following error: init csf.service could not be found.

And I can install it manually no problem. But that was not the idea. I want to automate deployments, so I therefor use the options.conf where csf=true. In the past this worked just fine, but yesterday I tried a clean install again and for some reason its not picked up. It does download csf, but does not install it.

Maybe something wrong with the custombuild script?
 
Hello,

This seems to be the second case when CSF/LFD is not installed or installed partly for the last day. You might open a ticket with Directadmin support, so that they could check it and apply a fix whenever it's required.
 
Thanks for the reply!

I get the following error: init csf.service could not be found.

And I can install it manually no problem. But that was not the idea. I want to automate deployments, so I therefor use the options.conf where csf=true. In the past this worked just fine, but yesterday I tried a clean install again and for some reason its not picked up. It does download csf, but does not install it.

Maybe something wrong with the custombuild script?


So, from what I read from your post, there was no problem if you install it manually following the step I gave to you? and the problem only occurs if u do a clean install of DA with csf=true setting in options.conf? Am I correct? I'm going to try this on AlmaLinux.

EDIT:

@aobh
I just purchased a VPS with AlmaLinux 9. I tested DA clean installation with only option csf=yes in options.conf. The service is running fine here:

1669798935156.png


Hi,

Just setup a new clean Debian 11 VM.

I missed this part. Did you install DirectAdmin on a virtual machine and are you sure you are using 64bit OS? Your issue is not reproducible for both OSes (Debian 11 64bit and AlmaLinux 9 64bit) on clean install. Like what @ zEitEr said, you should create a ticket.
 
Last edited:
So, from what I read from your post, there was no problem if you install it manually following the step I gave to you? and the problem only occurs if u do a clean install of DA with csf=true setting in options.conf? Am I correct? I'm going to try this on AlmaLinux.

Correct!

EDIT:

@aobh
I just purchased a VPS with AlmaLinux 9. I tested DA clean installation with only option csf=yes in options.conf. The service is running fine here:


I missed this part. Did you install DirectAdmin on a virtual machine and are you sure you are using 64bit OS? Your issue is not reproducible for both OSes (Debian 11 64bit and AlmaLinux 9 64bit) on clean install. Like what @ zEitEr said, you should create a ticket.

Yeah it was 64 bit. I reinstalled a new VM and tried it again, and I was able to reproduce it. I will create a ticket then.

Thanks guys!
 
One thing that concerns me is, CSF will not start automatically as a service (inactive status) and I have to manually start it (as seen in the screenshot). Maybe because the custombuild script doesn't know the current SSH port (some people might change it first before running setup.sh) and it doesn't want to start the firewall without whitelisting the SSH port first in CSF.
 
CSF adds user's IP into allowed list /etc/csf/csf.allow when one installs it. I saw servers with custom SSH port and running CSF/LFD. Usually owners of such servers show a sincere surprise, that we can not connect to SSH. And we either ask them to white-list our IPs or connect via DirectAdmin and open the access for us there.
 
Back
Top