Cluster Project branch, master, updated. cluster-2.99.00-28-gbde3c7b
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".
The branch, master has been updated
via bde3c7b21d7270174285956b81329efe84d50ba4 (commit)
from de09a3c352c5c5bb9dcc4e63d22a38c23798b4ea (commit)Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit bde3c7b21d7270174285956b81329efe84d50ba4
Author: David Teigland <[email protected]> Date: Wed May 7 11:16:28 2008 -0500
daemons: mostly daemonization stuff
- do lockfile before daemonizing
- use daemon(3)
- openlog even if not forking
- other little odds and ends
-----------------------------------------------------------------------
Summary of changes:
dlm/tool/main.c | 2 +- fence/fenced/main.c | 9 +++------ group/dlm_controld/deadlock.c | 4 ++-- group/dlm_controld/main.c | 34 +++++++++------------------------- group/gfs_controld/lock_dlm.h | 1 - group/gfs_controld/main.c | 39 ++++++++++----------------------------- group/tool/main.c | 2 +- 7 files changed, 26 insertions(+), 65 deletions(-)
dlm/tool/main.c +1 -1
@@ -55,7 +55,7 @@ static void print_usage(void) {printf ("Usage:\n" );printf ("\n" ); -printf ("%s [options] [join|leave|lockdump|lockdebug|list|dump|plocks|deadlock_check]\n" , prog_name); +printf ("%s [options] [join|leave|lockdump|lockdebug|ls|dump|plocks|deadlock_check]\n" , prog_name);printf ("\n" );printf ("Options:\n" );printf (" -v Verbose output\n" );
fence/fenced/main.c +3 -6
@@ -867,19 +867,16 @@ int main(int argc, char **argv)read_arguments (argc, argv); +lockfile (); +if (!daemon_debug_opt) {if (daemon (0 ,0 ) <0 ) {perror ("main: cannot fork" );exit (EXIT_FAILURE ); } -if (chdir ("/" ) <0 ) { -perror ("main: unable to chdir" ); -exit (EXIT_FAILURE ); - }umask (0 ); -openlog ("fenced" ,LOG_PID ,LOG_DAEMON ); } -lockfile (); +openlog ("fenced" ,LOG_PID ,LOG_DAEMON );signal (SIGTERM , sigterm_handler);set_oom_adj (-16 );
group/dlm_controld/deadlock.c +2 -2
@@ -367,7 +367,7 @@ static int read_debugfs_master(struct lockspace *ls)return -1 ;/* skip the header on the first line */ -if (!fgets (line,LOCK_LINE_MAX , file)) { +if (!fgets (line,LOCK_LINE_MAX , file)) {log_error ("Unable to read %s: %d" , path, errno); goto out; }
@@ -438,7 +438,7 @@ static int read_debugfs_locks(struct lockspace *ls)return -1 ;/* skip the header on the first line */ -if (!fgets (line,LOCK_LINE_MAX , file)) { +if (!fgets (line,LOCK_LINE_MAX , file)) {log_error ("Unable to read %s: %d" , path, errno); goto out; }
group/dlm_controld/main.c +9 -25
@@ -985,29 +985,6 @@ static void lockfile(void) } } -static void daemonize (void ) -{ -pid_t pid =fork (); -if (pid <0 ) { -perror ("main: cannot fork" ); -exit (EXIT_FAILURE ); - } -if (pid) -exit (EXIT_SUCCESS ); -setsid (); -if (chdir ("/" ) <0 ) { -perror ("main: unable to chdir" ); -exit (EXIT_FAILURE ); - } -umask (0 ); -close (0 ); -close (1 ); -close (2 ); -openlog ("dlm_controld" ,LOG_PID ,LOG_DAEMON ); - -lockfile (); -} -static void print_usage (void ) {printf ("Usage:\n" );
@@ -1176,8 +1153,15 @@ int main(int argc, char **argv)read_arguments (argc, argv); -if (!daemon_debug_opt) -daemonize (); +lockfile (); + +if (!daemon_debug_opt) { +if (daemon (0 ,0 ) <0 ) { +perror ("daemon error" ); +exit (EXIT_FAILURE ); + } + } +openlog ("dlm_controld" ,LOG_PID ,LOG_DAEMON );signal (SIGTERM , sigterm_handler);read_ccs ();
group/gfs_controld/lock_dlm.h +0 -1
@@ -67,7 +67,6 @@ enum { DO_DELIVER, }; -extern char *prog_name;extern int plock_debug_opt;extern int daemon_debug_opt;extern char daemon_debug_buf[256 ];
group/gfs_controld/main.c +10 -29
@@ -781,34 +781,11 @@ static void lockfile(void) } } -void daemonize (void ) -{ -pid_t pid =fork (); -if (pid <0 ) { -perror ("main: cannot fork" ); -exit (EXIT_FAILURE ); - } -if (pid) -exit (EXIT_SUCCESS ); -setsid (); -if (chdir ("/" ) <0 ) { -perror ("main: unable to chdir" ); -exit (EXIT_FAILURE ); - } -umask (0 ); -close (0 ); -close (1 ); -close (2 ); -openlog ("gfs_controld" ,LOG_PID ,LOG_DAEMON ); - -lockfile (); -} -static void print_usage (void ) {printf ("Usage:\n" );printf ("\n" ); -printf ("%s [options]\n" , prog_name); +printf ("gfs_controld [options]\n" );printf ("\n" );printf ("Options:\n" );printf ("\n" );
@@ -944,8 +921,6 @@ void set_scheduler(void)int main (int argc,char **argv) { - prog_name = argv[0 ]; -INIT_LIST_HEAD (&mounts);INIT_LIST_HEAD (&withdrawn_mounts);
@@ -959,8 +934,15 @@ int main(int argc, char **argv)decode_arguments (argc, argv); -if (!daemon_debug_opt) -daemonize (); +lockfile (); + +if (!daemon_debug_opt) { +if (daemon (0 ,0 ) <0 ) { +perror ("daemon error" ); +exit (EXIT_FAILURE ); + } + } +openlog ("gfs_controld" ,LOG_PID ,LOG_DAEMON );/* ccs settings override the defaults, but not the command line */ set_ccs_config ();
@@ -1002,7 +984,6 @@ void daemon_dump_save(void) } } -char *prog_name;int plock_debug_opt;int daemon_debug_opt;char daemon_debug_buf[256 ];
group/tool/main.c +1 -1
@@ -245,7 +245,7 @@ char *state_str(group_data_t *data)snprintf (buf,127 ,"%s %d %llx %d" ,ev_state_str (data->event_state), data->event_nodeid, - data->event_id, + (unsigned long long )data->event_id, data->event_local_status); else snprintf(buf, 127, "%s", ev_state_str(data->event_state));
hooks/post-receive
--
Cluster Project