Click to See Complete Forum and Search --> : Daemon Path and Pipe
redhanded
10-12-2002, 12:20 PM
I need to edit a couple of lines in a program.
And I don't have a clue what these two paths are:
1) "This is the currently running daemon process ID path"
2) "This is the location of the command pipe for the currently running daemon"
I'm operating in Redhat 8.0 and I'm attempting to log snmp trap messages.
I can provide further details if needed.
Thanks.
bastard23
10-12-2002, 09:18 PM
redhanded,
If you are looking for open files (sockets, pipes) of a running program use the lsof command. 'lsof -p <pid of running program>'. Other than that, I don't quite understand, maybe changing the config files for a program? If your looking for the files (config) installed w/ a package try rpm -q -l <package name>. Post more if you'd like as I'm a little confused what your trying to do (never used snmp).
Good Luck,
chris
redhanded
10-13-2002, 12:23 AM
Thanks Chris, at least you're taking a stab at it.
Essentially I'm trying to edit the makefile of a snmp logging program to enable linux to see my router logs. Below is the readme:
. Edit the 'Makefile' default paths as desired:
PIDDIR=\"/var/run/\"
This is the currently running daemon process ID path.
MSGDIR=\"/var/log/snmplog/\"
This is the location of the log files.
CMDDIR=\"/var/run/\"
This is the location of the command pipe for the currently running daemon.
MANPATH=\"/usr/man/\"
This is the path to your manpages where man1/snmplogd.1 will be placed.
PIDDIR = /var/run/
MSGDIR = /var/log/snmplog/
CMDDIR = /var/run/
MANPATH = /usr/man/
I did the make clean, make, make and install after leaving the above path as default (no edits).
While running the program I get the following:
[root@XXXXXXXX-A snmplog-1.2.5-Beta]# ./snmplogd -d
SNMPLog UDP Receiver daemon started.
[root@XXXXXXXX-A snmplog-1.2.5-Beta]# ./snmplogd -f
Unable to open command pipe "/var/run/snmplog.cmdpipe".
Error code: 2.
[root@XXXXXXXX-A snmplog-1.2.5-Beta]# ./snmplogd -p
Currently running SNMPLog PID = 1319.
I think I have a bad line in the CMDDIR...But I'm not sure, since I'm not certain what is being referred to by the command pipe.
bastard23
10-13-2002, 01:12 AM
redhanded,
Well, I'll keep stabbing. Are there any errors from the make install? Are there any scripts to start snmplod included? If the INSTALL file doesn't mention it, I would check the Makefile to see if it tries to "mkfifo" the /var/run/snmplog.cmdpipe file. (Does the /var/run dir exist?) What program are you using? Do any of the snmplog file mention any thing?
I'm just guessing here so try it last. I'm going to assume that the program is using named pipes. Try doing 'mkfifo /var/run/snmplog.cmdpipe' to create a named pipe. Check the ownership and permissions. See if it works. If it does, check the program documentation to see the proper way to do this. YMMV.
Good luck,
chris
redhanded
10-13-2002, 09:52 PM
I think I'll try the mkfifo...cmdpipe. Otherwise, I need to do some checking regarding my current setup. This program is a very simple program and when I run it to check my logs I'm seeing zero entries....which leads me back to some basic steps. Verifying that port 162:udp is open to receive from my router..
I know the router is configured properly to broadcast.
I suspect the new firewall that comes with Redhat 8.0...the config is very simple but when you attempt to make changes, like making eth0 a trusted device, manually configuring 162:udp, I'm not seeing the changes (working a bit in the dark with Redhat's new firewall). I've got both snmp and snmptrap running.
I think I'll start over at square one and begin anew, checking each item along the way - Thanks for your help.
redhanded
10-13-2002, 11:22 PM
So viewing my ip tables, I see the following:
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Lokkit-0-50-INPUT (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT udp -- ns2.xxxxx.com anywhere udp spt:domain
ACCEPT udp -- ns5.xxxxx.com anywhere udp spt:domain
REJECT tcp -- anywhere anywhere tcp flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT udp -- anywhere anywhere udp reject-with icmp-port-unreachable
It appears that my INPUT table (last line) rejects any any udp -
Now I want to accept udp packets on port 162
so would you think I should add a line below the last accept to read:
ACCEPT udp --192.168.1.1 port 162:udp
and leave the last REJECT line - the last accept udp will accept packets from my router and send to port 162 on my pc.
Then the last line will deny any any udp.
Not certain if the syntax is correct.
Thoughts?