Thursday, January 27, 2011

SL_Proxy 1.9.3 on Mac and Cygwin

In my old blog, I talked about this app a lot. It really saves my butt with my ISP. I just upgraded it yesterday and needed to patch the source again. So, I thought I'd write up what I needed to do.

First, here are my old posts on the subject:

This gets a little technical, so I apologize to those who don't quite follow along. Making a patch file for these is pretty easy, but the last time I did it, I didn't put in the version number. Unfortunately, my old patch file won't work on this source. I plan to make a new patch file this weekend, but I thought I'd write down what I did first.

For Mac:
  • Edit each of these files, changing all the instances of 'chown' from "chown nobody.$GRP" to "chown nobody:$$GRP"
    • sl_proxy-1.9.3/sl_info/
    • sl_proxy-1.9.3/sl_relay/
    • sl_proxy-1.9.3/sl_proxy/
    • sl_proxy-1.9.3/sip_forwarder/
  • autoreconf && ./configure && make
For Cygwin:
The problem is there's no yp headers in Cygwin. All one has to do is remove the checks, surrounding them with #ifndef __CYGWIN__ blocks.
  • junkbox_lib-1.2.4/Lib/password.h @ line 38
#ifndef __CYGWIN__
#include <rpcsvc/ypclnt.h>
#endif // __CYGWIN__

  • junkbox_lib-1.2.4/Lib/password.c
@line 58
#ifndef __CYGWIN__
// for NIS
pw = getnisnam(user_id);
if (pw!=NULL) {
strncpy(pass, pw->pw_passwd, LPASS);
return pass;
#endif // __CYGWIN__
@line 74-164
#ifndef __CYGWIN__

struct passwd* getnisnam(char* usrid)

(lots of code)

return pw;

#endif // __CYGWIN__

void free_pw(struct passwd* pw)

These processes won't auto-start on boot, even if you run 'make install'. It will place the executables into /usr/local/bin and make some inet.d changes in /etc, but they aren't honored on boot. I always start them by hand, using 'screen' so I can easily disconnect or reconnect to see the logs. Like I wrote in my earlier posts, I create a screen console for each process and run these commands (on cygwin, you don't need to 'sudo'):
sudo /usr/local/bin/sl_info -l -v0 -d -f1
sudo /usr/local/bin/sl_cache -l -v0 -lx -xpr 90 -d
sudo /usr/local/bin/sl_relay -v0 -cs -ci -d

1 comment:

  1. This is wonderful! Please do post your patch soon, I'd never heard of it before and really want to try it out!