All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM received
@ 2010-05-27 18:21 Alexey Mahotkin
  2010-05-29  3:00 ` [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM Paul Mackerras
  2010-05-29 20:27 ` [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM received Alexey Mahotkin
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Mahotkin @ 2010-05-27 18:21 UTC (permalink / raw)
  To: linux-ppp

---
 pppd/main.c                  |    2 +-
 pppd/plugins/radius/radius.c |    5 ++++-
 pppd/pppd.h                  |    1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/pppd/main.c b/pppd/main.c
index 3cc2624..f97c8ad 100644
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -633,7 +633,7 @@ handle_events()
 	kill_link = 1;
 	asked_to_quit = 1;
 	persist = 0;
-	status = EXIT_USER_REQUEST;
+	status = EXIT_SIGTERM;
 	got_sigterm = 0;
     }
     if (got_sigchld) {
diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c
index b882e7a..5d1c619 100644
--- a/pppd/plugins/radius/radius.c
+++ b/pppd/plugins/radius/radius.c
@@ -989,10 +989,13 @@ radius_acct_stop(void)
     av_type = PW_NAS_ERROR;
     switch( status ) {
 	case EXIT_OK:
-	case EXIT_USER_REQUEST:
 	    av_type = PW_USER_REQUEST;
 	    break;
 
+	case EXIT_SIGTERM:
+	    av_type = PW_ADMIN_RESET;
+	    break;
+
 	case EXIT_HANGUP:
 	case EXIT_PEER_DEAD:
 	case EXIT_CONNECT_FAILED:
diff --git a/pppd/pppd.h b/pppd/pppd.h
index cf9840a..dfa9112 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -808,6 +808,7 @@ extern void (*snoop_send_hook) __P((unsigned char *p, int len));
 #define EXIT_TRAFFIC_LIMIT	20
 #endif
 #define EXIT_CNID_AUTH_FAILED	21
+#define EXIT_SIGTERM	        23
 
 /*
  * Debug macros.  Slightly useful for finding bugs in pppd, not particularly
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM
  2010-05-27 18:21 [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM received Alexey Mahotkin
@ 2010-05-29  3:00 ` Paul Mackerras
  2010-05-29 20:27 ` [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM received Alexey Mahotkin
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2010-05-29  3:00 UTC (permalink / raw)
  To: linux-ppp

First off, thanks for putting together this set of patches.  This one
needs a little more explanation, however, concerning what the
distinction between the existing EXIT_USER_REQUEST and the new
EXIT_SIGTERM is.  Why do we need a separate code for kill -TERM vs.
kill -HUP?  And shouldn't a ^C at pppd's controlling terminal result
in EXIT_USER_REQUEST rather than EXIT_SIGTERM?

Adding a new EXIT_SIGTERM also has the possibility of breaking
existing scripts that look at pppd's exit code.  Plus, if we're going
to add it, it would need to be documented in pppd.8.

On the whole, I think it would be better just to make
EXIT_USER_REQUEST result in PW_ADMIN_RESET and drop the new
EXIT_SIGTERM.

Paul.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM received
  2010-05-27 18:21 [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM received Alexey Mahotkin
  2010-05-29  3:00 ` [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM Paul Mackerras
@ 2010-05-29 20:27 ` Alexey Mahotkin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexey Mahotkin @ 2010-05-29 20:27 UTC (permalink / raw)
  To: linux-ppp

On Sat, May 29, 2010 at 7:00 AM, Paul Mackerras <paulus@samba.org> wrote:
> On the whole, I think it would be better just to make
> EXIT_USER_REQUEST result in PW_ADMIN_RESET and drop the new
> EXIT_SIGTERM.

Ok, I'll agree.

Thank you,

-- 
Alexey Mahotkin
http://squadette.ru/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-29 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-27 18:21 [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM received Alexey Mahotkin
2010-05-29  3:00 ` [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM Paul Mackerras
2010-05-29 20:27 ` [PATCH 6/6] Use Disconnect-Cause=Admin-Reset if SIGTERM received Alexey Mahotkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.