tac_plus ipv6 only in single-process mode

170 views
Skip to first unread message

vjai

unread,
Sep 16, 2011, 11:35:14 AM9/16/11
to Event-Driven Servers, sharm...@gmail.com

Hi All,

I have been trying to make tac_plus work over IPv6.

Couple of things I have noticed.

1) Option -v does not work.
2) tac_plus works only in "-1" mode, i.e. enable single-process
("degraded") mode.

Please let me know if there is some thing I am not doing properly.
Working command for tac_plus when used over IPv6: tac_plus /root/
tac_plus/tac_plus.cfg -1

tac-plus version: Version: 201109122012/PCRE/DES/CURL

Configuration file:
#!/usr/local/sbin/tac_plus
id = spawnd {
listen = {address=2001::b9 port = 49 }
# spawn = {
# instances min = 1
# instances max = 10
# }
# background = yes
}
id = tac_plus {
debug = PACKET AUTHEN AUTHOR

key = abcde123
access log = /root/tac_plus/access.log
accounting log = /root/tac_plus/acct.log
user = admin {
password = permit
pap = clear admins
chap = clear admins
member = admin
service = shell {
default command = permit
default attribute = permit
set priv-lvl = 15
#default authorization = permit

}
}
}
=======================
Please let me know if some one else has faced similar issues and steps
taken to over come it.
Looking forward for expert comments regarding this.

Thanks in advance,
Vijay

Marc Huber

unread,
Sep 16, 2011, 1:58:35 PM9/16/11
to event-driv...@googlegroups.com, sharm...@gmail.com
Hi Vijai,


On Friday, September 16, 2011 5:35:14 PM UTC+2, vjai wrote:
1) Option -v does not work.
2) tac_plus works only in "-1" mode, i.e.  enable single-process
("degraded") mode.

this indicates non-working file-descriptor passing.

What kind of system is that? Would you mind sharing your "uname -a" output?

Cheers,

Marc

vijay sharma

unread,
Sep 16, 2011, 9:38:53 PM9/16/11
to event-driv...@googlegroups.com
Marc, 

I am using SUSE. 

Linux linux-hwe8 2.6.34.7-0.7-desktop #1 SMP PREEMPT 2010-12-13 11:13:53 +0100 x86_64 x86_64 x86_64 GNU/Linux
linux-hwe8:~ #


Also including log messages. These are generated in non working case:
Sep 16 12:38:43 linux-hwe8 tac_plus[11841]: startup (version 201109122012)
Sep 16 12:38:43 linux-hwe8 tac_plus[11841]: epoll event notification mechanism is being used
Sep 16 12:38:43 linux-hwe8 tac_plus[11841]: bind to [2001::b9]:49 succeeded
Sep 16 12:38:43 linux-hwe8 tac_plus[11842]: execl (/usr/local/sbin/tac_plusΨb@/#177, ...) (/root/tac_plus/PROJECTS/mavis/spawnd_scm_spawn.c:115): No such file or directory
Sep 16 12:38:43 linux-hwe8 tac_plus[11843]: execl (/usr/local/sbin/tac_plusΨb@/#177, ...) (/root/tac_plus/PROJECTS/mavis/spawnd_scm_spawn.c:115): No such file or directory
Sep 16 12:38:50 linux-hwe8 tac_plus[11841]: scm_send_msg (/root/tac_plus/PROJECTS/mavis/spawnd_accepted.c:213): Connection refused
Sep 16 12:38:50 linux-hwe8 tac_plus[11841]: scm_send_msg (/root/tac_plus/PROJECTS/mavis/spawnd_accepted.c:213): Connection refused
Sep 16 12:38:50 linux-hwe8 tac_plus[11845]: execl (/usr/local/sbin/tac_plusΨb@/#177, ...) (/root/tac_plus/PROJECTS/mavis/spawnd_scm_spawn.c:115): No such file or directory

Thanks,
Vijay

Marc Huber

unread,
Sep 17, 2011, 3:06:34 AM9/17/11
to event-driv...@googlegroups.com, sharm...@gmail.com
Hi Vijay,

thanks ... I should have read the man page for readlink(3) more carefully. Patch below (and in snapshot 201109170904).

Cheers,

Marc


--- mavis/spawnd_main.c    2011/08/21 13:18:16    1.79
+++ mavis/spawnd_main.c    2011/09/17 07:02:26
@@ -98,6 +98,7 @@
 static void get_exec_path(char **path, char *dflt)
 {
     char tmp[PATH_MAX];
+    ssize_t rls;
 
     if (strchr(dflt, '/')) {
     *path = strdup(dflt);
@@ -138,18 +139,14 @@
     }
 #endif
 
-    if (-1 < readlink("/proc/self/exe", tmp, sizeof(tmp))) {
-    *path = strdup(tmp);
-    return;
+    rls = readlink("/proc/self/exe", tmp, sizeof(tmp));
+    if (rls < 0)
+    rls = readlink("/proc/curproc/file", tmp, sizeof(tmp));
+    if (rls < 0) {
+    snprintf(tmp, sizeof(tmp), "/proc/%lu/exe", (u_long) getpid());
+    rls = readlink(tmp, tmp, sizeof(tmp));
     }
-
-    if (-1 < readlink("/proc/curproc/file", tmp, sizeof(tmp))) {
-    *path = strdup(tmp);
-    return;
-    }
-
-    snprintf(tmp, sizeof(tmp), "/proc/%lu/exe", (u_long) getpid());
-    if (-1 < readlink(tmp, tmp, sizeof(tmp))) {
+    if (rls > 0) {
     *path = strdup(tmp);
     return;
     }

Marc Huber

unread,
Sep 17, 2011, 3:26:30 AM9/17/11
to event-driv...@googlegroups.com, sharm...@gmail.com
Forgot string termination. My bad. Corrected patch below, or snapshot 201109170923.


Cheers,

Marc

--- mavis/spawnd_main.c    2011/08/21 13:18:16    1.79
+++ mavis/spawnd_main.c    2011/09/17 07:22:24

@@ -98,6 +98,7 @@
 static void get_exec_path(char **path, char *dflt)
 {
     char tmp[PATH_MAX];
+    ssize_t rls;
 
     if (strchr(dflt, '/')) {
     *path = strdup(dflt);
@@ -138,18 +139,15 @@

     }
 #endif
 
-    if (-1 < readlink("/proc/self/exe", tmp, sizeof(tmp))) {
-    *path = strdup(tmp);
-    return;
+    rls = readlink("/proc/self/exe", tmp, sizeof(tmp));
+    if (rls < 0)
+    rls = readlink("/proc/curproc/file", tmp, sizeof(tmp));
+    if (rls < 0) {
+    snprintf(tmp, sizeof(tmp), "/proc/%lu/exe", (u_long) getpid());
+    rls = readlink(tmp, tmp, sizeof(tmp));
     }
-
-    if (-1 < readlink("/proc/curproc/file", tmp, sizeof(tmp))) {
-    *path = strdup(tmp);
-    return;
-    }
-
-    snprintf(tmp, sizeof(tmp), "/proc/%lu/exe", (u_long) getpid());
-    if (-1 < readlink(tmp, tmp, sizeof(tmp))) {
+    if (rls > 0) {
+    tmp[rls] = 0;
     *path = strdup(tmp);
     return;
     }

vijay sharma

unread,
Sep 19, 2011, 1:14:47 AM9/19/11
to event-driv...@googlegroups.com
Thanks Marc. 
Took latest changes and its working fine now. :-)

Regards,
Vijay
Reply all
Reply to author
Forward
0 new messages