Results 1 to 7 of 7

Thread: Howto run post-boot when ftp is off

  1. #1
    Join Date
    Aug 2005
    Location
    Eindhoven, The Netherlands
    Posts
    125

    Howto run post-boot when ftp is off

    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?

  2. #2
    Join Date
    Jun 2005
    Location
    Karlsruhe, Germany
    Posts
    44
    Yes, enable stupidftp and add the command
    killall stupidftp
    in your post-boot script.

  3. #3
    Join Date
    Aug 2005
    Location
    Eindhoven, The Netherlands
    Posts
    125
    Quote Originally Posted by samoht
    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.

  4. #4
    Join Date
    May 2005
    Location
    Braga, Portugal
    Posts
    19
    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".

  5. #5
    Join Date
    Aug 2005
    Location
    Eindhoven, The Netherlands
    Posts
    125
    Ow but it IS processed (post-boot), only not when I disable FTP with the web interface... so that's not normal?

  6. #6
    Join Date
    Jul 2004
    Location
    near Lyon @ France
    Posts
    195
    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
    Code:
    #!/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

  7. #7
    Join Date
    Aug 2005
    Location
    Eindhoven, The Netherlands
    Posts
    125
    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
    Last edited by Jethro; 27-08-2005 at 21:56.

Similar Threads

  1. Start own script in post-boot or post-firewall
    By m-h-l in forum WL-500g Q&A
    Replies: 2
    Last Post: 30-09-2005, 19:03
  2. post-boot is not executed - what's wrong?
    By sbn in forum WL-500g Q&A
    Replies: 0
    Last Post: 11-06-2005, 12:17
  3. Shell scripts and post-boot
    By samoht in forum WL-500g Q&A
    Replies: 5
    Last Post: 03-06-2005, 23:58
  4. Replies: 9
    Last Post: 18-02-2005, 19:42
  5. Replies: 3
    Last Post: 24-12-2004, 19:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •