DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd May 2008
amac amac is offline
New User
 
Join Date: May 2008
Posts: 2
Thanked 0 Times in 0 Posts
Default Possible to run multiple instances of ftp-proxy on boot?

I recently upgraded (from 3.7) to 4.2 and ftp-proxy is no longer run from inetd. What I'm curious about is how to start multiple instances...

For example, I have 2 machines I want to forward FTP traffic to which is behind my pf firewall:

--- from /etc/rc.conf.local ---
Code:
ftpproxy_flags="-R 10.1.1.14 -p 21 -b 63.231.0.14"
ftpproxy_flags="-R 10.1.1.53 -p 21 -b 63.231.0.53"
I can manually start both instances, but if I reboot the machine, or run the /etc/rc script manually, only the last instance comes up:


Code:
fw# lsof -ni:21
COMMAND     PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
ftp-proxy 23505 proxy    3u  IPv4 0xfffffe8009fd5000      0t0  TCP 63.231.0.53:ftp (LISTEN)
fw#

What's the proper way to accomplish this? I'm hoping I don't have to hack a script together to do this. inetd worked great in this instance, and I hesitate saying that because I'm not a big inetd fan in general

Any help appreciated!

(formally known as -- ariston)
Reply With Quote
  #2   (View Single Post)  
Old 22nd May 2008
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,719
Thanked 214 Times in 189 Posts
Default

  • /etc/rc.conf and /etc/rc.conf.local are only used to set variables. They are not for command execution. Therefore, your two lines won't work as written, only the last line will be used.

    For 4.3, please refer to /etc/rc line 219 and /etc/rc.conf lines 104-106 to see how /etc/rc.conf and /etc/rc.conf.local are used.
  • The easiest solution is to start your multiple ftp-proxy sessions from /etc/rc.local. See /etc/rc lines 678-680 to see how ftp-proxy is started.
Reply With Quote
  #3   (View Single Post)  
Old 23rd May 2008
amac amac is offline
New User
 
Join Date: May 2008
Posts: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jggimi View Post
  • /etc/rc.conf and /etc/rc.conf.local are only used to set variables. They are not for command execution. Therefore, your two lines won't work as written, only the last line will be used.

    For 4.3, please refer to /etc/rc line 219 and /etc/rc.conf lines 104-106 to see how /etc/rc.conf and /etc/rc.conf.local are used.
  • The easiest solution is to start your multiple ftp-proxy sessions from /etc/rc.local. See /etc/rc lines 678-680 to see how ftp-proxy is started.
I'm working on 4.2, so I think there are some differences....

/etc/rc line 219
Code:
RULES="$RULES\npass out inet6 proto icmp6 all icmp6-type neighbrsol"

which isn't it, and i'm not sure what your after there.. the only lines that have ftp-proxy in /etc/rc is 652->654:
Code:
652 if [ X"${ftpproxy_flags}" != X"NO" ]; then
653         echo -n ' ftp-proxy';           /usr/sbin/ftp-proxy ${ftpproxy_flags}
654 fi

....and your saying to start my multiple ftp-proxy instances via rc.local, which I guess makes sense (sorry, I'm clearly not familiar with BSD rc* files / scripts).


So..... for those of you who are trying to do this same thing I'm after here, I've removed what I had in /etc/rc.conf.local, and modified /etc/rc.local... (my current rc.local below)


Code:
#       $OpenBSD: rc.local,v 1.39 2006/07/28 20:19:46 sturm Exp $

# Site-specific startup actions, daemons, and other things which
# can be done AFTER your system goes into securemode.  For actions
# which should be done BEFORE your system has gone into securemode
# please see /etc/rc.securelevel.

echo -n 'starting local daemons:'

# Add your local startup actions here.
/usr/bin/ftp-proxy -R 10.1.1.14 -p 21 -b 63.231.0.14
/usr/bin/ftp-proxy -R 10.1.1.53 -p 21 -b 63.231.0.53



echo '.'

After sourcing rc.local, things are looking good:


Code:
fw# . /etc/rc.local 
starting local daemons:
.

fw# lsof -ni:21
COMMAND     PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
ftp-proxy 20686 proxy    3u  IPv4 0xfffffe8009fd5228      0t0  TCP 63.231.0.53:ftp (LISTEN)
ftp-proxy 20848 proxy    3u  IPv4 0xfffffe8009fd5000      0t0  TCP 63.231.0.14:ftp (LISTEN)
fw#
w00t... thanks jggimi
Reply With Quote
  #4   (View Single Post)  
Old 23rd May 2008
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,719
Thanked 214 Times in 189 Posts
Default

No problem. You no longer need 4.2 /etc/rc line numbers.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp-proxy in openbsd brody OpenBSD General 2 20th October 2008 04:18 PM
Tunnel to Proxy PatrickBaer General software and network 2 11th August 2008 03:32 PM
Multiple instances of Opera ebzzry FreeBSD General 7 24th July 2008 03:53 AM
Dual-boot laptop won't boot OpenBSD after upgrade to 4.3 kbeaucha OpenBSD Installation and Upgrading 17 30th May 2008 02:40 PM
pf and ftp-proxy clinty OpenBSD Security 5 7th May 2008 10:36 PM


All times are GMT. The time now is 08:25 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick