Changing log folder on Linux - specify log, config, PID directories

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
ladowny
Posts: 2
Joined: Mon Nov 04, 2024 3:20 pm

Changing log folder on Linux - specify log, config, PID directories

Post by ladowny » Mon Nov 04, 2024 6:25 pm

I'm running Debian 12 x86_64 GNU/Linux and trying to compile SoftEther with different than it's default log directory location

In https://github.com/SoftEtherVPN/SoftEth ... LD_UNIX.md - Specify log, config, PID directories I read

To specify directories, perform ./configure like below.

Code: Select all

CMAKE_FLAGS="-DSE_PIDDIR=/run/softether -DSE_LOGDIR=/var/log/softether -DSE_DBDIR=/var/lib/softether" ./configure
What I'm doing is

Code: Select all

cd /usr/src
git clone https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.git
cd SoftEtherVPN_Stable/
git submodule init && git submodule update
mkdir -p /var/log/softether && mkdir -p /var/lib/softether && mkdir -p /run/softether
CMAKE_FLAGS="-DSE_PIDDIR=/run/softether -DSE_LOGDIR=/var/log/softether -DSE_DBDIR=/var/lib/softether" ./configure
make 
make install
The compilation is succesfull and vpnserver starts but the log dir and other dirs are still under /usr/vpnserver/ directory.
What am I doing wrong? How can I have the logs in /var/log ?

Jason McLean
Posts: 2
Joined: Mon Nov 11, 2024 7:13 am

Re: Changing log folder on Linux - specify log, config, PID directories

Post by Jason McLean » Mon Nov 11, 2024 7:24 am

It looks like the CMAKE_FLAGS are not being passed properly to the ./configure script, as SoftEther’s configuration may require using cmake directly rather than ./configure to respect these flags.
You can try:

Code: Select all

# Clone the repository and initialize submodules
cd /usr/src
git clone https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.git
cd SoftEtherVPN_Stable/
git submodule init && git submodule update

# Create the necessary directories
mkdir -p /var/log/softether /var/lib/softether /run/softether

# Prepare the build directory and remove any cached files
rm -rf build && mkdir build
cd build

# Run cmake with the custom directory flags
cmake -DSE_PIDDIR=/run/softether -DSE_LOGDIR=/var/log/softether -DSE_DBDIR=/var/lib/softether ..

# Compile and install
make
make install
Regard,

ladowny
Posts: 2
Joined: Mon Nov 04, 2024 3:20 pm

Re: Changing log folder on Linux - specify log, config, PID directories

Post by ladowny » Tue Nov 12, 2024 10:27 pm

Thanks Jason, tried to follow your suggestion, but when I run cmake I'm getting an error

Code: Select all

$ cmake -DSE_PIDDIR=/run/softether -DSE_LOGDIR=/var/log/softether -DSE_DBDIR=/var/lib/softether -B /usr/src/SoftEtherVPN_Stable/build -S /usr/src/SoftEtherVPN_Stable/src

CMake Error: The source directory "/usr/src/SoftEtherVPN_Stable/src" does not appear to contain CMakeLists.txt.
Could not find that file anywhere in sources. After further digging I found the file in Developer Edition (DE), Stable Edition (SE) I was using seems to be a couple of years behind. I managed to compile the Developer Edition and found a Debian package that is most likely based on it as it supports logging to /var/log and uses the same paths.

So I cloned https://github.com/SoftEtherVPN/SoftEtherVPN.git instead of https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.git and it does work.

Jason McLean
Posts: 2
Joined: Mon Nov 11, 2024 7:13 am

Re: Changing log folder on Linux - specify log, config, PID directories

Post by Jason McLean » Wed Nov 13, 2024 8:09 am

ladowny wrote:
Tue Nov 12, 2024 10:27 pm
geometry dash meltdown
Thanks Jason, tried to follow your suggestion, but when I run cmake I'm getting an error

Code: Select all

$ cmake -DSE_PIDDIR=/run/softether -DSE_LOGDIR=/var/log/softether -DSE_DBDIR=/var/lib/softether -B /usr/src/SoftEtherVPN_Stable/build -S /usr/src/SoftEtherVPN_Stable/src 

CMake Error: The source directory "/usr/src/SoftEtherVPN_Stable/src" does not appear to contain CMakeLists.txt.
Could not find that file anywhere in sources. After further digging I found the file in Developer Edition (DE), Stable Edition (SE) I was using seems to be a couple of years behind. I managed to compile the Developer Edition and found a Debian package that is most likely based on it as it supports logging to /var/log and uses the same paths.

So I cloned https://github.com/SoftEtherVPN/SoftEtherVPN.git instead of https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.git and it does work.
I got it. Thank you

Post Reply