From fcbb06414d2c8385ce4e68f23905a528c8fbd4e8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 17 Aug 2002 14:34:48 +0000 Subject: sync 3.0 branch with HEAD (This used to be commit d53d77cc8e21dfbfd376d529661ef299e14e31a0) --- source3/web/startstop.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'source3/web/startstop.c') 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) { -- cgit