summaryrefslogtreecommitdiff
path: root/source3/web/startstop.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-07-27 01:37:33 +0000
committerSimo Sorce <idra@samba.org>2002-07-27 01:37:33 +0000
commit2ff0939301d738a3f8177ddb6e01781b638ce811 (patch)
tree3133df5b39dcbcc3208f72e7ed10852cf8fe64c6 /source3/web/startstop.c
parent2a03547b6142ab934840332cda37013982cbe723 (diff)
downloadsamba-2ff0939301d738a3f8177ddb6e01781b638ce811.tar.gz
samba-2ff0939301d738a3f8177ddb6e01781b638ce811.tar.bz2
samba-2ff0939301d738a3f8177ddb6e01781b638ce811.zip
as per user request added windbind start/stop/restart in swat
almost working, seem it does not yet properly detect if windbind is running or not in all situations testing is welcome. (This used to be commit e0988e918667e3bc7b7cfb19ae81bf8c05fe582a)
Diffstat (limited to 'source3/web/startstop.c')
-rw-r--r--source3/web/startstop.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/source3/web/startstop.c b/source3/web/startstop.c
index 893784dd55..e10dff4118 100644
--- a/source3/web/startstop.c
+++ b/source3/web/startstop.c
@@ -67,6 +67,27 @@ void start_nmbd(void)
exit(0);
}
+/** Startup winbindd from web interface. */
+void start_winbindd(void)
+{
+ pstring binfile;
+
+ if (geteuid() != 0) return;
+
+ if (fork()) {
+ sleep(SLEEP_TIME);
+ return;
+ }
+
+ slprintf(binfile, sizeof(pstring) - 1, "%s/winbindd", dyn_SBINDIR);
+
+ become_daemon();
+
+ execl(binfile, binfile, NULL);
+
+ exit(0);
+}
+
/* stop smbd */
void stop_smbd(void)
@@ -91,7 +112,19 @@ void stop_nmbd(void)
kill(pid, SIGTERM);
}
+#ifdef WITH_WINBIND
+/* stop winbindd */
+void stop_winbindd(void)
+{
+ pid_t pid = pidfile_pid("winbindd");
+ if (geteuid() != 0) return;
+
+ if (pid <= 0) return;
+
+ kill(pid, SIGTERM);
+}
+#endif
/* kill a specified process */
void kill_pid(pid_t pid)
{