PDA

Bekijk de volledige versie : Howto run post-boot when ftp is off



Jethro
25-08-2005, 22:10
When I disable the FTP service through the web interface, stupid-ftpd is not started, but also the post-boot file is not processed, which means I don't know how to load all additional packages I've installed...

Is there a workaround for this?

samoht
26-08-2005, 08:36
Yes, enable stupidftp and add the command
killall stupidftp
in your post-boot script.

Jethro
26-08-2005, 12:30
Yes, enable stupidftp and add the command
killall stupidftp
in your post-boot script.
Sorry, I should have mentioned that I did that already. No effect. Should it work without problem or additional commands in post-boot?

I read somewhere that I have to test if it is loaded already (something like: 'if ps |grep "stupid-ftpd" then killall stupid-ftpd') but since Iim not the scripting champ, I'll have to figure that out.

SocoNaTromba
27-08-2005, 12:57
as far as I know you don't need stupidftp to be running for post-boot to work.
check if you placed the post-boot file correctly as /tmp/local/sbin/post-boot , and bshure to allow execute permissions with "chmod +x /tmp/local/sbin/post-boot".

Jethro
27-08-2005, 20:05
Ow but it IS processed (post-boot), only not when I disable FTP with the web interface... so that's not normal?

Jean-Fabrice
27-08-2005, 20:45
My post-boot is executed and I don't have stupidftpd running. I'm using 1.9.2.7-5a.
Could you please copy/paste here your post-boot and also post-* files ?

JF

PS : here is my working post-boot


#!/bin/sh
echo 4096 > /proc/sys/net/ipv4/ip_conntrack_max
/usr/sbin/dropbear
/usr/sbin/portmap
insmod sunrpc
insmod lockd
insmod nfs
mount -a
[ -x /opt/etc/init.d/rc.unslung ] && /opt/etc/init.d/rc.unslung
/usr/sbin/crond
killall syslogd
/sbin/syslogd -m 0 -S -l 7 -R 192.168.0.252

Jethro
27-08-2005, 21:54
Here is my /usr/local/sbin/post-boot file:


#!/bin/sh
mount /dev/discs/disc0/part1 /opt
mount /dev/discs/disc0/part1 /tmp/harddisk
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done

/usr/sbin/dropbear

# Activate swap
swapon /dev/discs/disc0/part2

# Run all active services
/opt/etc/init.d/rc.unslung



and my /usr/local/sbin/post-firewall file:


#!/bin/sh
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

iptables -t nat -A PREROUTING -i $1 -p tcp --dport 8080 -j DNAT --to-destination $4:8080
iptables -t nat -A PREROUTING -i $1 -p tcp --dport 22 -j DNAT --to-destination $4:22

iptables -A INPUT -j DROP



I made a file that starts my stupid-ftpd server (/opt/etc/init.d/S98ftpd chmod'ed with 755):


#!/bin/sh
killall stupid-ftpd
/usr/sbin/stupid-ftpd -f /opt/usr/stupid-ftpd.conf