Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] vsftpd rc-update
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Thu May 19, 2022 7:22 am    Post subject: [Solved] vsftpd rc-update Reply with quote

Hello, I have enabled vsftpd at default run level

Code:
➜ rc-update show default
            bluetooth | default
               cronie | default
               dhcpcd | default
            ip6tables | default
             iptables | default
                local | default
             netmount | default
                 noip | default
                 ntpd | default
          qemu-binfmt | default
                samba | default
                 sshd | default
             sysklogd | default
               vsftpd | default
                  xdm | default


However after reboot it the ftp server is not accessable "Connection Refused"

When I stop and start the vsftpd service then its working and I can connect.

Code:
➜ rc-service vsftpd stop
 * Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/vsftpd stop
 * Stopping vsftpd ...
 * Will stop /usr/sbin/vsftpd
 * Will stop PID 2757
 * Will stop processes of `/usr/sbin/vsftpd'
 * start-stop-daemon: no matching processes found [ ok ]

➜ rc-service vsftpd start
 * Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/vsftpd start
 * Starting vsftpd ...
 * start-stop-daemon: fopen `/run/vsftpd.pid': No such file or directory
 * Detaching to start `/usr/sbin/vsftpd' ...


Is there any way to make this service active upon reboot/power on? Thank you.


Last edited by FilthyPitDog on Thu May 19, 2022 8:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu May 19, 2022 10:10 am    Post subject: Reply with quote

From the systemd service file
Code:

cat /lib/systemd/system/vsftpd.service
[Unit]
Description=Very Secure FTP Daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/vsftpd

[Install]
WantedBy=multi-user.target

i see it needs network.
In your rc-status output I see nothing about network @default.
Is it maybe enabled @boot?
_________________
:)


Last edited by alamahant on Thu May 19, 2022 2:38 pm; edited 3 times in total
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Thu May 19, 2022 10:13 am    Post subject: Reply with quote

alamahant wrote:
Is it maybe enabled @boot?


Aha indeed Network is not enabled @boot

What would be recommended to enable network @default or @boot? Thanks very much :)
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu May 19, 2022 10:16 am    Post subject: Reply with quote

Quote:

What would be recommended to enable network @default or @boot? Thanks very much :)

@default
_________________
:)
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Thu May 19, 2022 10:30 am    Post subject: Reply with quote

It seems I dont have a "network" service? I added
Code:
net.enp6s0 | default


but that didnt solve it, I feel like im missing something obvious
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu May 19, 2022 10:33 am    Post subject: Reply with quote

Plz try
Code:

cd /etc/init.d
ln -s net.lo net.enp6s0
rc-update add net.enp6s0 default

Then edit /etc/conf.d/net
to configure net.enp6s0
In its simplest form
Code:

config_enp6s0="dhcp"

or statically
Code:

config_enp6s0="192.168.235.55/24"
routes_enp6s0="default via 192.168.235.1"

dns_servers_enp6s0="8.8.8.8"


for example
_________________
:)
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Thu May 19, 2022 10:44 am    Post subject: Reply with quote

alamahant wrote:
Then edit
to configure net.enp6s0


I checked here https://wiki.gentoo.org/wiki/Handbook:X86/Full/Networking#Getting_started

Code:
➜ ls /etc/init.d |grep enp
net.enp6s0 -> net.lo


Code:
➜ cat /etc/conf.d/net
config_enp6s0="dhcp"
config_wlp7s0="dhcp"
modules="wpa_supplicant"
wpa_supplicant_wlan0="-Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf"


started net.enp6s0 service, stopped it. then added to @default

Is there something im missing in conf.d/net that you can see?
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu May 19, 2022 10:49 am    Post subject: Reply with quote

No it seems fine.
You do have i suppose enp6s0 connected to the router with ethernet cable no?
For your wifi you should check it yourself.
Sometimes it proves tricky.
One thing disable wpa_supplicant and let netifrc handle it.
Also plz dont have both wifi and ethernet enabled at the same time.
You will not be able to use any because dhcp will assign default gateways to both and this is a no-no.
You could theoretically have them both enabled but configure one of them statically to NOT be assigned a default gateway.
_________________
:)


Last edited by alamahant on Thu May 19, 2022 10:54 am; edited 1 time in total
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Thu May 19, 2022 10:51 am    Post subject: Reply with quote

alamahant wrote:
No it seems fine.
You do have i suppose enp6s0 connected to the router with ethernet cable no?


All hardwired yes, router to card
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Thu May 19, 2022 11:05 am    Post subject: Reply with quote

I checked /var/log/rc.log for net.enp6s0

Code:
 * Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/net.enp6s0 start
 * Bringing up interface enp6s0
 *   Caching network module dependencies
 *   Skipping module adsl due to missing program: /usr/sbin/adsl-start /usr/sbin/pppoe-start
 *   Skipping module br2684ctl due to missing program: br2684ctl
 *   Skipping module clip due to missing program: /usr/sbin/atmsigd
 *   Skipping module ethtool due to missing program: ethtool
 *   Skipping module netplugd due to missing program: /sbin/netplugd
 *   Skipping module ifplugd due to missing program: /usr/sbin/ifplugd
 *   Skipping module ipppd due to missing program: /usr/sbin/ipppd
 *   Skipping module iwconfig due to missing program: /sbin/iwconfig
 *   Skipping module firewalld due to missing program: firewall-cmd
 *   Skipping module udhcpc due to missing program: /bin/busybox
 *   Skipping module pump due to missing program: /sbin/pump
 *   Skipping module dhclient due to missing program: /sbin/dhclient
 *   Skipping module dhclientv6 due to missing program: /sbin/dhclient
 *   Skipping module wireguard due to missing program: /usr/bin/wg
 *   Loaded modules: apipa arping bonding l2tp tuntap bridge ccwgroup dummy hsr macvlan macchanger macnet wpa_supplicant ssidnet iproute2 pppd system vlan dhcpcd ip6rd ip6to4 veth
 *   ip link set dev enp6s0 up
 *   Configuring enp6s0 for MAC address E0:D5:5E:AA:F9:D2 ...
 [ ok ]
 *   dhcp ...
 *     Running dhcpcd ...
sending commands to dhcpcd process
 [ ok ]
 *     received address
 [ ok ]
 *   ip -4 route flush table cache dev enp6s0
 *   ip -6 route flush table cache dev enp6s0


Not sure if I need any of those modules? But other than that seems fine I guess?
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu May 19, 2022 11:12 am    Post subject: Reply with quote

Quote:

Not sure if I need any of those modules? But other than that seems fine I guess?


No its ok.
You use dhcpcd I suppose no?
Ah yes its in the output.
No it seems ok.
Although i am not sure why your log is so verbose.
Mine just mentions
"Caching network module dependencies"
_________________
:)


Last edited by alamahant on Thu May 19, 2022 11:17 am; edited 1 time in total
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Thu May 19, 2022 11:13 am    Post subject: Reply with quote

alamahant wrote:
Quote:

Not sure if I need any of those modules? But other than that seems fine I guess?


No its ok.
You use dhcpcd I suppose no?


Correct, yes I do
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1659

PostPosted: Thu May 19, 2022 12:47 pm    Post subject: Reply with quote

First off, undo everything alamahant has said so far.

You started off with the dhcpcd service which should never be paired with the netifrc services (net.enp6s0 in this case).

Next, check the logs of the service and also if any firewall is blocking the port since you have stored iptables rules

Edit: After rereading the OP, perhaps configure /etc/conf.d/net-online for a ping test. Then, add rc_need="network-online" to /etc/conf.d/vsftpd to have the service wait for dhcpcd's background operations to finish is the appropriate fix.

Edit 2: Alternatively, look at adding the waitip option to /etc/dhcpcd.conf


Last edited by grknight on Thu May 19, 2022 4:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu May 19, 2022 2:44 pm    Post subject: Reply with quote

grknight
From the wiki
Code:

Of course, it's possible to use dhcpcd together with net.* scripts. In fact, if dhcpcd is installed, it's used as the default DHCP client if config_eth0="dhcp" is set in /etc/conf.d/net.

So what is to be undone among my sayings?
Can you plz be a bit more specific.
Do you mean to imply the fact the OP has dhcpcd enabled therefore he does not need netifrc scipts?
Thanks
_________________
:)
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1659

PostPosted: Thu May 19, 2022 3:00 pm    Post subject: Reply with quote

alamahant wrote:
grknight
From the wiki
Code:

Of course, it's possible to use dhcpcd together with net.* scripts. In fact, if dhcpcd is installed, it's used as the default DHCP client if config_eth0="dhcp" is set in /etc/conf.d/net.

So what is to be undone among my sayings?
Can you plz be a bit more specific.
Do you mean to imply the fact the OP has dhcpcd enabled therefore he does not need netifrc scipts?
Thanks


I mean that one cannot mix the dhcpcd service with any netifrc service without more advanced configurations. Doing so causes issues of two processes fighting for control.

Since the OP listed dhcpcd service enabled, instructions on netifrc are not the way to go.

Even if they were swapped, the network-online requirement may be necessary depending on how vsftpd is configured and programmed.
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Thu May 19, 2022 8:26 pm    Post subject: Reply with quote

grknight wrote:
Edit 2: Alternatively, look at adding the waitip option to /etc/dhcpcd.conf


This worked perfectly for my needs and only adds about 5 seconds to boot time. Thnx guys!!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum