SRCS.printconfig=print.c parse.c util.c
BINDIR= /bin
-MAN.service=
+MAN.service= service.8
MAN.printconfig=
CPPFLAGS+= -I${NETBSDSRCDIR}
service \- Manage an operating system service.
.SH SYNOPSIS
.PP
-\fBservice [-c -r -n -p] (up|run|edit|update)\fR \fI<binary|self>\fR
+\fBservice [-b -c -n -p -r] (up|run|edit|update)\fR \fI<binary|self>\fR
[\fB-args\fR \fI<args>\fR] [\fB-dev\fR \fI<special>\fR]
[\fB-devstyle\fR \fI<style>\fR] [\fB-period\fR \fI<ticks>\fR]
[\fB-script\fR \fI<path>\fR] [\fB-label\fR \fI<name>\fR]
system service fails to restart, \fBRS\fR will immediately resort to
a system-wide panic. The \fBup\fR action takes the following options:
.TP
+.BI \-b " "
+disable the usage of binary exponential restart time in \fBRS\fR.
+.TP
.BI \-c " "
\fBRS\fR normally relies on the binary on the disk to restart a
system service. The
when the location on the disk may change or if the service itself is
required to read the binary from the disk (e.g. the disk driver).
.TP
-.BI \-r " "
-when saving an in-memory copy, instructs \fBRS\fR to reuse and share the copy
-of an existing service with the same program name, if available.
-.TP
.BI \-n " "
by default, \fBRS\fR performs blocking startup of the system service. As
a result, the \fBup\fR action does not terminate until the system service
necessary when the service itself is required to create a working
service instance (e.g. \fBPM\fR).
.TP
+.BI \-r " "
+when saving an in-memory copy, instructs \fBRS\fR to reuse and share the copy
+of an existing service with the same program name, if available.
+.TP
.BI \-args " <args>"
specifies the command line arguments to use to run the program
given by \fI<binary>\fR. The default is to use no arguments.
char *hz, *buff;
int req_nr;
int c, i, j;
- int c_flag, r_flag, n_flag, p_flag;
+ int b_flag, c_flag, r_flag, n_flag, p_flag;
int label_required;
+ b_flag = 0;
c_flag = 0;
r_flag = 0;
n_flag = 0;
p_flag = 0;
- while (c= getopt(argc, argv, "rcnp?"), c != -1)
+ while (c= getopt(argc, argv, "rbcnp?"), c != -1)
{
switch(c)
{
case '?':
print_usage(argv[ARG_NAME], "wrong number of arguments");
exit(EINVAL);
+ case 'b':
+ b_flag = 1;
+ break;
case 'c':
c_flag = 1;
break;
if(p_flag)
*rss_flags |= RSS_REPLICA;
+ if(b_flag)
+ *rss_flags |= RSS_NO_BIN_EXP;
+
req_path = argv[optind+ARG_PATH];
if(req_nr == RS_UPDATE && !strcmp(req_path, SELF_BINARY)) {
/* Self update needs no real path or configuration file. */
#define RSS_SELF_LU 0x20 /* perform self update */
#define RSS_SYS_BASIC_CALLS 0x40 /* include basic kernel calls */
#define RSS_VM_BASIC_CALLS 0x80 /* include basic vm calls */
+#define RSS_NO_BIN_EXP 0x100 /* suppress binary exponential offset */
/* Common definitions. */
#define RS_NR_CONTROL 8
ossdevlinks.8 part.8 partition.8 \
poweroff.8 printroot.8 pr_routes.8 pwdauth.8 rarpd.8 \
rdate.8 readclock.8 reboot.8 repartition.8 \
- rshd.8 screendump.8 serial-ip.8 service.8 \
+ rshd.8 screendump.8 serial-ip.8 \
setup.8 shutdown.8 slip.8 srccrc.8 syslogd.8 tcpd.8 \
unix.8 update.8 usage.8 vbfs.8
#define SF_USE_COPY 0x008 /* set when process has a copy in memory */
#define SF_NEED_REPL 0x010 /* set when process needs replica to start */
#define SF_USE_REPL 0x020 /* set when process has a replica */
+#define SF_NO_BIN_EXP 0x040 /* set when we should ignore binary exp. offset */
#define IMM_SF \
- (SF_CORE_SRV | SF_SYNCH_BOOT | SF_NEED_COPY | SF_NEED_REPL) /* immutable */
+ (SF_NO_BIN_EXP | SF_CORE_SRV | SF_SYNCH_BOOT | SF_NEED_COPY | SF_NEED_REPL) /* immutable */
/* Constants determining RS period and binary exponential backoff. */
#define RS_INIT_T (system_hz * 10) /* allow T ticks for init */
* a binary exponential backoff.
*/
if (rp->r_restarts > 0) {
- rp->r_backoff = 1 << MIN(rp->r_restarts,(BACKOFF_BITS-2));
- rp->r_backoff = MIN(rp->r_backoff,MAX_BACKOFF);
- if ((rpub->sys_flags & SF_USE_COPY) && rp->r_backoff > 1)
- rp->r_backoff= 1;
+ if (!(rpub->sys_flags & SF_NO_BIN_EXP)) {
+ rp->r_backoff = 1 << MIN(rp->r_restarts,(BACKOFF_BITS-2));
+ rp->r_backoff = MIN(rp->r_backoff,MAX_BACKOFF);
+ if ((rpub->sys_flags & SF_USE_COPY) && rp->r_backoff > 1)
+ rp->r_backoff= 1;
+ }
+ else {
+ rp->r_backoff = 1;
+ }
return;
}
if (rs_start->rss_flags & RSS_REPLICA) {
rpub->sys_flags |= SF_USE_REPL;
}
+ if (rs_start->rss_flags & RSS_NO_BIN_EXP) {
+ rpub->sys_flags |= SF_NO_BIN_EXP;
+ }
/* Update period. */
if(rpub->endpoint != RS_PROC_NR) {