5 | | |
6 | | Patch is here: |
7 | | diff -ur bitlbee-1.0/account.c bitlbee-1.0.new/account.c |
8 | | --- bitlbee-1.0/account.c 2005-11-18 01:17:04.000000000 +0100 |
9 | | +++ bitlbee-1.0.new/account.c 2005-12-11 19:50:00.258792320 +0100 |
10 | | @@ -154,3 +154,25 @@ |
11 | | cancel_auto_reconnect( a ); |
12 | | } |
13 | | } |
14 | | + |
15 | | +void reconnect_all_accounts( void ) |
16 | | +{ |
17 | | + irc_t *irc; |
18 | | + account_t *account; |
19 | | + GSList *ircconn; |
20 | | + |
21 | | + for ( ircconn = irc_connection_list; ircconn; |
22 | | + ircconn = ircconn->next ) { |
23 | | + irc = ircconn->data; |
24 | | + if ( !set_getint( irc, "auto_reconnect" ) ) |
25 | | + continue; |
26 | | + |
27 | | + irc_usermsg( irc, "Reconnecting active accounts..." ); |
28 | | + |
29 | | + for ( account = irc->accounts; account; |
30 | | + account = account->next ) { |
31 | | + if ( account->gc ) |
32 | | + signoff( account-> gc ); |
33 | | + } |
34 | | + } |
35 | | +} |
36 | | diff -ur bitlbee-1.0/account.h bitlbee-1.0.new/account.h |
37 | | --- bitlbee-1.0/account.h 2005-11-18 01:17:04.000000000 +0100 |
38 | | +++ bitlbee-1.0.new/account.h 2005-12-11 19:50:00.258792320 +0100 |
39 | | @@ -45,5 +45,6 @@ |
40 | | void account_del( irc_t *irc, account_t *acc ); |
41 | | void account_on( irc_t *irc, account_t *a ); |
42 | | void account_off( irc_t *irc, account_t *a ); |
43 | | +void reconnect_all_accounts( void ); |
44 | | |
45 | | #endif |
46 | | diff -ur bitlbee-1.0/doc/bitlbee.8 bitlbee-1.0.new/doc/bitlbee.8 |
47 | | --- bitlbee-1.0/doc/bitlbee.8 2005-11-21 12:41:29.000000000 +0100 |
48 | | +++ bitlbee-1.0.new/doc/bitlbee.8 2005-12-11 23:37:11.929463384 +0100 |
49 | | @@ -86,6 +86,12 @@ |
50 | | .SH COMMANDS |
51 | | To get a complete list of commands, please use the \fBhelp commands\fP |
52 | | command in the &bitlbee channel. |
53 | | +.SH SIGNALS |
54 | | +.IP SIGTERM |
55 | | +Sending \fBSIGTERM\fP twice causes bitlbee to exit. |
56 | | +.IP SIGUSR1 |
57 | | +Upon receiving \fBSIGUSR1\fP, bitlbee reconnects all active accounts on |
58 | | +all connected clients. |
59 | | .SH "SEE ALSO" |
60 | | .BR ircd (8), |
61 | | .BR inetd (8), |
62 | | diff -ur bitlbee-1.0/unix.c bitlbee-1.0.new/unix.c |
63 | | --- bitlbee-1.0/unix.c 2005-11-18 01:17:04.000000000 +0100 |
64 | | +++ bitlbee-1.0.new/unix.c 2005-12-11 19:50:00.258792320 +0100 |
65 | | @@ -74,6 +74,7 @@ |
66 | | memset( &sig, 0, sizeof( sig ) ); |
67 | | sig.sa_handler = sighandler; |
68 | | sigaction( SIGPIPE, &sig, &old ); |
69 | | + sigaction( SIGUSR1, &sig, &old ); |
70 | | sig.sa_flags = SA_RESETHAND; |
71 | | sigaction( SIGINT, &sig, &old ); |
72 | | sigaction( SIGILL, &sig, &old ); |
73 | | @@ -126,6 +127,10 @@ |
74 | | raise( signal ); |
75 | | } |
76 | | } |
77 | | + else if( signal == SIGUSR1) |
78 | | + { |
79 | | + reconnect_all_accounts(); |
80 | | + } |
81 | | else if( signal != SIGPIPE ) |
82 | | { |
83 | | log_message( LOGLVL_ERROR, "Fatal signal received: %d. That's probably a bug.", signal ); |