Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using the Pure-ftpd daemon to serve ftp service. I've modified the init script to run multiple domains with different IPs, with separate DBs and separate WELCOME MSGs.

daemon "$pure_launch_script /etc/pure-ftpd/dom1.conf --daemonize > /dev/null -F /etc/pure-ftpd/dom1.msg"
daemon "$pure_launch_script /etc/pure-ftpd/dom2.conf --daemonize > /dev/null -F /etc/pure-ftpd/dom2.msg"
daemon "$pure_launch_script /etc/pure-ftpd/dom3.conf --daemonize > /dev/null -F /etc/pure-ftpd/dom2.msg"

Everything working flawlessly and perfect without errors. But the pain the ass is that all the domains that i serving are logged (verbose) in only one xfer.log file. It's not comfortable for investigate and monitor the activity. My system using rsyslog wich is very advanced ... So, my only solution that i see is to filter the messages, but must be filtered by the IP of the interface that is dedicated to the each one of the multiple servers and can't find filter for this in rsyslog. That only option is fromhost-ip ... wich is not working in my case, can't filter by $msg contains because the users are logged like user@remoteip...

I'm the black hole now... if somebody have a good idea it will be great.

share|improve this question
    
Are details you want logged in case of using "-O" switch? Or maybe you want to enable verbose log. –  GioMac Aug 28 '13 at 19:00
    
"-O" not work with xfer log format, now i use verbose log ... but now everything is in 1 file... big mess... –  Stavry Aug 28 '13 at 19:25
    
Your goal is to monitor activity and define to which instance does it belong, right? Or you want to have xfer log too? –  GioMac Aug 28 '13 at 19:41
    
I need to separate the xfer log (verbose log generated by rsyslog) to each one process which is started by init script that i modified. The init script starts multiple instances of daemon with different settings but the log file is only one. –  Stavry Aug 28 '13 at 19:47
    
A very nice question, here's your answer :) –  GioMac Aug 28 '13 at 19:53
add comment

1 Answer

A. You need to modify the code (ouch)

B. Create named pipe, so all three instances can write to it, from the other side you can read all messages with simple script and according to running pid you'll know to which instance does the message belong to

http://www.linuxjournal.com/content/using-named-pipes-fifos-bash

With other manipulations I'm very sure you can automate it by writing variables (PID) during the startup of each instance, so you won't need to check pid of instance everytime you parse the output.

share|improve this answer
    
I search for more simple solution, i think the rsyslog daemon can do more things that i don't know... thank u for your solution... –  Stavry Aug 29 '13 at 7:04
    
The only difference between instances is PID and listened ip address. Instances aren't showing it's address in output, so, only option is PID. You can add $SystemLogUsePIDFromSystem on to the rsyslog configuration and it will add PID's to the message, but you need to know to which instance does it belong to, this cannot be done with rsyslog, so, rsyslog is not an option. This is the simplest solution - you only need to write a very simple bash script and check pid of pure-ftpd instance when starting. –  GioMac Aug 29 '13 at 9:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.