av[ac++] = op;
}
if (run_mode & STATIC_HOSTNAME) {
- av[ac++] = "-N";
+ av[ac++] = "-v";
av[ac++] = MY_NAME;
}
av[ac] = NULL;
- fprintf(stderr, "%s: -N deprecated, consider using /usr/sbin/sm-notify directly\n",
- name_p);
execv(av[0], av);
fprintf(stderr, "%s: failed to run %s\n", name_p, av[0]);
exit(2);
int arg;
int port = 0, out_port = 0;
struct rlimit rlim;
+ int once = 1;
int pipefds[2] = { -1, -1};
char status;
exit(-1);
}
- if (run_mode & MODE_NOTIFY_ONLY)
+ if (run_mode & MODE_NOTIFY_ONLY) {
+ fprintf(stderr, "%s: -N deprecated, consider using /usr/sbin/sm-notify directly\n",
+ name_p);
run_sm_notify(out_port);
+ }
if (!(run_mode & MODE_NODAEMON)) {
waitpid(pid, NULL, 0);
}
- drop_privs();
+ /* Make sure we have a privilege port for calling into the kernel */
+ statd_get_socket();
for (;;) {
pmap_unset (SM_PROG, SM_VERS);
/* this registers both UDP and TCP services */
rpc_init("statd", SM_PROG, SM_VERS, sm_prog_1, port);
+ if (once) {
+ once = 0;
+ drop_privs();
+ }
/*
* Handle incoming requests: SM_NOTIFY socket requests, as
* well as callbacks from lockd.