The extra code in source3/lib/pidfile.c is no longer needed.
#include "libsmb/nmblib.h"
#include "messages.h"
#include "librpc/gen_ndr/samr.h"
#include "libsmb/nmblib.h"
#include "messages.h"
#include "librpc/gen_ndr/samr.h"
+#include "../lib/util/pidfile.h"
/*
* cli_send_mailslot, send a mailslot for client code ...
/*
* cli_send_mailslot, send a mailslot for client code ...
if (tevent_req_nomem(state->my_mailslot, req)) {
return tevent_req_post(req, ev);
}
if (tevent_req_nomem(state->my_mailslot, req)) {
return tevent_req_post(req, ev);
}
- state->nmbd_pid = pidfile_pid_s3("nmbd");
+ state->nmbd_pid = pidfile_pid(lp_piddir(), "nmbd");
if (state->nmbd_pid == 0) {
DEBUG(3, ("No nmbd found\n"));
tevent_req_nterror(req, NT_STATUS_NOT_SUPPORTED);
if (state->nmbd_pid == 0) {
DEBUG(3, ("No nmbd found\n"));
tevent_req_nterror(req, NT_STATUS_NOT_SUPPORTED);
#include "nmbd/nmbd.h"
#include "serverid.h"
#include "messages.h"
#include "nmbd/nmbd.h"
#include "serverid.h"
#include "messages.h"
+#include "../lib/util/pidfile.h"
int ClientNMB = -1;
int ClientDGRAM = -1;
int ClientNMB = -1;
int ClientDGRAM = -1;
gencache_stabilize();
serverid_deregister(messaging_server_id(msg));
gencache_stabilize();
serverid_deregister(messaging_server_id(msg));
- pidfile_unlink_s3("nmbd");
+ pidfile_unlink(lp_piddir(), "nmbd");
mkdir(lp_piddir(), 0755);
}
mkdir(lp_piddir(), 0755);
}
- pidfile_create_s3("nmbd");
+ pidfile_create(lp_piddir(), "nmbd");
status = reinit_after_fork(msg, nmbd_event_context(),
false);
status = reinit_after_fork(msg, nmbd_event_context(),
false);
#include "lib/param/param.h"
#include "lib/background.h"
#include "lib/conn_tdb.h"
#include "lib/param/param.h"
#include "lib/background.h"
#include "lib/conn_tdb.h"
+#include "../lib/util/pidfile.h"
struct smbd_open_socket;
struct smbd_child_pid;
struct smbd_open_socket;
struct smbd_child_pid;
mkdir(lp_piddir(), 0755);
if (is_daemon)
mkdir(lp_piddir(), 0755);
if (is_daemon)
- pidfile_create_s3("smbd");
+ pidfile_create(lp_piddir(), "smbd");
status = reinit_after_fork(msg_ctx,
ev_ctx,
status = reinit_after_fork(msg_ctx,
ev_ctx,
#include "printing.h"
#include "serverid.h"
#include "messages.h"
#include "printing.h"
#include "serverid.h"
#include "messages.h"
+#include "../lib/util/pidfile.h"
static struct files_struct *log_writeable_file_fn(
struct files_struct *fsp, void *private_data)
static struct files_struct *log_writeable_file_fn(
struct files_struct *fsp, void *private_data)
DEBUG(3,("Server exit (%s)\n",
(reason ? reason : "normal exit")));
if (am_parent) {
DEBUG(3,("Server exit (%s)\n",
(reason ? reason : "normal exit")));
if (am_parent) {
- pidfile_unlink_s3("smbd");
+ pidfile_unlink(lp_piddir(), "smbd");
}
gencache_stabilize();
}
}
gencache_stabilize();
}
#include "libsmb/nmblib.h"
#include "messages.h"
#include "util_tdb.h"
#include "libsmb/nmblib.h"
#include "messages.h"
#include "util_tdb.h"
+#include "../lib/util/pidfile.h"
#if HAVE_LIBUNWIND_H
#include <libunwind.h>
#if HAVE_LIBUNWIND_H
#include <libunwind.h>
/* Look up other destinations in pidfile directory */
/* Look up other destinations in pidfile directory */
- if ((pid = pidfile_pid_s3(dest)) != 0) {
+ if ((pid = pidfile_pid(lp_piddir(), dest)) != 0) {
return pid_to_procid(pid);
}
return pid_to_procid(pid);
}
#include "includes.h"
#include "web/swat_proto.h"
#include "dynconfig/dynconfig.h"
#include "includes.h"
#include "web/swat_proto.h"
#include "dynconfig/dynconfig.h"
+#include "../lib/util/pidfile.h"
/** Startup smbd from web interface. */
void start_smbd(void)
/** Startup smbd from web interface. */
void start_smbd(void)
/* stop smbd */
void stop_smbd(void)
{
/* stop smbd */
void stop_smbd(void)
{
- pid_t pid = pidfile_pid_s3("smbd");
+ pid_t pid = pidfile_pid(lp_piddir(), "smbd");
if (geteuid() != 0) return;
if (geteuid() != 0) return;
/* stop nmbd */
void stop_nmbd(void)
{
/* stop nmbd */
void stop_nmbd(void)
{
- pid_t pid = pidfile_pid_s3("nmbd");
+ pid_t pid = pidfile_pid(lp_piddir(), "nmbd");
if (geteuid() != 0) return;
if (geteuid() != 0) return;
/* stop winbindd */
void stop_winbindd(void)
{
/* stop winbindd */
void stop_winbindd(void)
{
- pid_t pid = pidfile_pid_s3("winbindd");
+ pid_t pid = pidfile_pid(lp_piddir(), "winbindd");
if (geteuid() != 0) return;
if (geteuid() != 0) return;
#include "locking/proto.h"
#include "librpc/gen_ndr/open_files.h"
#include "lib/conn_tdb.h"
#include "locking/proto.h"
#include "librpc/gen_ndr/open_files.h"
#include "lib/conn_tdb.h"
+#include "../lib/util/pidfile.h"
#define _(x) lang_msg_rotate(talloc_tos(),x)
#define _(x) lang_msg_rotate(talloc_tos(),x)
TALLOC_CTX *ctx = talloc_stackframe();
const char form_name[] = "status";
TALLOC_CTX *ctx = talloc_stackframe();
const char form_name[] = "status";
- smbd_pid = pid_to_procid(pidfile_pid_s3("smbd"));
+ smbd_pid = pid_to_procid(pidfile_pid(lp_piddir(), "smbd"));
if (!verify_xsrf_token(form_name)) {
goto output_page;
if (!verify_xsrf_token(form_name)) {
goto output_page;
#include "serverid.h"
#include "auth.h"
#include "messages.h"
#include "serverid.h"
#include "auth.h"
#include "messages.h"
+#include "../lib/util/pidfile.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
if (is_parent) {
serverid_deregister(procid_self());
if (is_parent) {
serverid_deregister(procid_self());
- pidfile_unlink_s3("winbindd");
+ pidfile_unlink(lp_piddir(), "winbindd");
if (!interactive)
become_daemon(Fork, no_process_group, log_stdout);
if (!interactive)
become_daemon(Fork, no_process_group, log_stdout);
- pidfile_create_s3("winbindd");
+ pidfile_create(lp_piddir(), "winbindd");