View previous topic :: View next topic |
Author |
Message |
cord Guru
Joined: 28 Apr 2007 Posts: 344
|
Posted: Mon Aug 02, 2021 6:45 pm Post subject: [solved]systemd and proftpd without external net |
|
|
Hello, I have faced the problem with start proftpd service when there's no external net. It's notebook, and it not always has external network connection. But there's Virtual Machine (QEMU, libvirt, virt-manager) and internal bridge 'virbr0', which is used to exchange files between host (thru ftp) and guest systems.
So, when I enable proftpd service:
Code: | systemctl enable proftpd |
it doesn't start at boot:
Code: | # systemctl status proftpd
× proftpd.service - ProFTPd FTP daemon
Loaded: loaded (/lib/systemd/system/proftpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2021-08-02 21:23:18 EEST; 1min 3s ago
Process: 995 ExecStart=/usr/sbin/proftpd --nodaemon (code=exited, status=1/FAILURE)
Main PID: 995 (code=exited, status=1/FAILURE)
CPU: 4ms
Aug 02 21:23:18 msi systemd[1]: proftpd.service: Scheduled restart job, restart counter is at 5.
Aug 02 21:23:18 msi systemd[1]: Stopped ProFTPd FTP daemon.
Aug 02 21:23:18 msi systemd[1]: proftpd.service: Start request repeated too quickly.
Aug 02 21:23:18 msi systemd[1]: proftpd.service: Failed with result 'exit-code'.
Aug 02 21:23:18 msi systemd[1]: Failed to start ProFTPd FTP daemon. |
If network connection is appear proftpd can be started normally.
Code: | # systemctl start proftpd
# systemctl status proftpd
● proftpd.service - ProFTPd FTP daemon
Loaded: loaded (/lib/systemd/system/proftpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2021-08-02 21:24:25 EEST; 2s ago
Main PID: 1213 (proftpd)
CPU: 15ms
CGroup: /system.slice/proftpd.service
└─1213 proftpd: (accepting connections)
Aug 02 21:24:25 msi systemd[1]: Started ProFTPd FTP daemon.
Aug 02 21:24:25 msi proftpd[1213]: 2021-08-02 21:24:25,382 msi proftpd[1213] msi.lan: ProFTPD 1.3.7a (maint) (built Wed Jul 28 2021 02:10:45 EEST) standalone mode STARTUP |
So, how to set proftpd service to don't wait network?
ps On OpenRC system it was solved by setting rc_need="!net" to /etc/conf.d/proftpd.conf, but how to set it in systemd?
Last edited by cord on Wed Aug 04, 2021 7:40 am; edited 1 time in total |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Mon Aug 02, 2021 8:17 pm Post subject: |
|
|
You didn't post the error message that tells us the reason for the failure during boot.
So I can only guess.
It is well known that Systemd starts services before the network is up and running. Therefore, services must work even is the network is not available.
Do you configure a DefaultAddress in the Proftpd config file?
If you do: set the DefaultAddress to 0.0.0.0 or remove the directive. |
|
Back to top |
|
|
cord Guru
Joined: 28 Apr 2007 Posts: 344
|
Posted: Tue Aug 03, 2021 4:30 pm Post subject: |
|
|
mike155 wrote: | You didn't post the error message that tells us the reason for the failure during boot. |
Thanks for the answer. How to show the error message? (sorry, I'm new in systemd)
mike155 wrote: | Do you configure a DefaultAddress in the Proftpd config file?
If you do: set the DefaultAddress to 0.0.0.0 or remove the directive. |
No, it's not set. Here's proftpd.conf:
Code: | ServerName "ProFTPD Default Server"
ServerType standalone
DefaultServer on
RequireValidShell off
AuthPAM off
AuthPAMConfig ftp
Port 21
Umask 022
MaxInstances 30
User ftp
Group ftp
DefaultRoot ~
AllowOverwrite on
<Limit SITE_CHMOD>
DenyAll
</Limit>
<Anonymous ~ftp>
User ftp
Group ftp
UserAlias anonymous ftp
MaxClients 10
<Directory uploads/*>
<Limit STOR>
AllowAll
</Limit>
</Directory>
</Anonymous> |
|
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Wed Aug 04, 2021 12:29 am Post subject: |
|
|
I just installed proftpd. On my machine, Systemd starts proftpd during boot.
Quote: | How to show the error message? (sorry, I'm new in systemd) |
Please run
"journalctl -b" will show you all messages since the machine was booted.
Then search for messages from proftpd: Enter "/" (slash), which will move you to the bottom line of your screen. Type "proftpd" and press Enter! Use "n" to jump to the next match and "N" to jump to the previous match.
Is there a message that can shed some light on the issue? |
|
Back to top |
|
|
cord Guru
Joined: 28 Apr 2007 Posts: 344
|
Posted: Wed Aug 04, 2021 7:40 am Post subject: |
|
|
Thanks for your suggest. The problem is solved by adding
Code: | DefaultAddress 127.0.0.1 |
to /etc/proftpd/proftpd.conf
Now it starts at boot normally. |
|
Back to top |
|
|
|