This adds a new option, master_detach, to allow pppd to detach from
the controlling terminal when it is the multilink bundle master but
its own link has terminated, even if the nodetach option has been
given.
Requested-by: Stephen Marron <sfm@boxfusion.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
(*the_channel->cleanup)();
if (doing_multilink && multilink_master) {
(*the_channel->cleanup)();
if (doing_multilink && multilink_master) {
- if (!bundle_terminating)
+ if (!bundle_terminating) {
+ if (master_detach && !detached)
+ detach();
+ } else
mp_bundle_terminated();
} else
new_phase(PHASE_DEAD);
mp_bundle_terminated();
} else
new_phase(PHASE_DEAD);
char devnam[MAXPATHLEN]; /* Device name */
bool nodetach = 0; /* Don't detach from controlling tty */
bool updetach = 0; /* Detach once link is up */
char devnam[MAXPATHLEN]; /* Device name */
bool nodetach = 0; /* Don't detach from controlling tty */
bool updetach = 0; /* Detach once link is up */
+bool master_detach; /* Detach when we're (only) multilink master */
int maxconnect = 0; /* Maximum connect time */
char user[MAXNAMELEN]; /* Username for PAP */
char passwd[MAXSECRETLEN]; /* Password for PAP */
int maxconnect = 0; /* Maximum connect time */
char user[MAXNAMELEN]; /* Username for PAP */
char passwd[MAXSECRETLEN]; /* Password for PAP */
"Detach from controlling tty once link is up",
OPT_PRIOSUB | OPT_A2CLR | 1, &nodetach },
"Detach from controlling tty once link is up",
OPT_PRIOSUB | OPT_A2CLR | 1, &nodetach },
+ { "master_detach", o_bool, &master_detach,
+ "Detach when we're multilink master but have no link", 1 },
+
{ "holdoff", o_int, &holdoff,
"Set time in seconds before retrying connection",
OPT_PRIO, &holdoff_specified },
{ "holdoff", o_int, &holdoff,
"Set time in seconds before retrying connection",
OPT_PRIO, &holdoff_specified },
system password database to be allowed access. See also the
\fBenable\-session\fR option.
.TP
system password database to be allowed access. See also the
\fBenable\-session\fR option.
.TP
+.B master_detach
+If multilink is enabled and this pppd process is the multilink bundle
+master, and the link controlled by this pppd process terminates, this
+pppd process continues to run in order to maintain the bundle. If the
+\fBmaster_detach\fR option has been given, pppd will detach from its
+controlling terminal in this situation, even if the \fBnodetach\fR
+option has been given.
+.TP
.B maxconnect \fIn
Terminate the connection when it has been available for network
traffic for \fIn\fR seconds (i.e. \fIn\fR seconds after the first
.B maxconnect \fIn
Terminate the connection when it has been available for network
traffic for \fIn\fR seconds (i.e. \fIn\fR seconds after the first
extern bool lockflag; /* Create lock file to lock the serial dev */
extern bool nodetach; /* Don't detach from controlling tty */
extern bool updetach; /* Detach from controlling tty when link up */
extern bool lockflag; /* Create lock file to lock the serial dev */
extern bool nodetach; /* Don't detach from controlling tty */
extern bool updetach; /* Detach from controlling tty when link up */
+extern bool master_detach; /* Detach when multilink master without link */
extern char *initializer; /* Script to initialize physical link */
extern char *connect_script; /* Script to establish physical link */
extern char *disconnect_script; /* Script to disestablish physical link */
extern char *initializer; /* Script to initialize physical link */
extern char *connect_script; /* Script to establish physical link */
extern char *disconnect_script; /* Script to disestablish physical link */