ALT Linux Bugzilla
– Attachment 834 Details for
Bug 6606
Свой патч для исходников netams
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Мои правки кода netams на основе наблюдений за запуском программы через init-скрипт.
netams-src.patch (text/plain), 2.51 KB, created by
Sergei Epiphanov
on 2005-04-21 11:08:44 MSD
(
hide
)
Description:
Мои правки кода netams на основе наблюдений за запуском программы через init-скрипт.
Filename:
MIME Type:
Creator:
Sergei Epiphanov
Created:
2005-04-21 11:08:44 MSD
Size:
2.51 KB
patch
obsolete
>diff -Naur src.orig/common.c src/common.c >--- src.orig/common.c 2005-02-25 20:30:03 +0300 >+++ src/common.c 2005-04-11 13:49:39 +0400 >@@ -203,7 +203,7 @@ > void termination(int signal){ > global_return_code=signal; > sleep(1); //we should wait until sMain is sleeping, this is not guarantee this >- printf("\n"); >+// printf("\n"); > if(signal==PARSE_KILL || signal==SIGKILL) { > aMemoryRelease(); > char buf[32]; >diff -Naur src.orig/main.c src/main.c >--- src.orig/main.c 2005-02-25 20:30:03 +0300 >+++ src/main.c 2005-04-11 13:53:58 +0400 >@@ -73,18 +73,6 @@ > setvbuf(LOGFILE, NULL, _IOLBF, 0); > } > >- if (flag_pid && !flag_nopid) { >- if (pid_file_name==NULL) pid_file_name=set_string("/var/run/netams.pid"); >- FILE *pidfile = fopen(pid_file_name, "wt"); >- >- if (pidfile!=NULL) { >- fprintf(pidfile, "%u\n", getpid()); >- fclose(pidfile); >- } else { >- fprintf(stderr, "Can't create pid-file: %s\n", strerror(errno)); >- } >- } >- > if (flag_syslog) openlog("netams", 0, LOG_DAEMON); > if (!flag_quiet) aShowVersion(stdout); > if (flag_log) aShowVersion(LOGFILE); >@@ -99,10 +87,22 @@ > if(chdir(RUN_PATH)<0) > aLog(D_CRIT, "Cannot chdir to directory %s: %s\n",RUN_PATH,strerror(errno)); > aLog(D_INFO, "Becoming a daemon...\n"); >- daemon(1, 1); >+ daemon(1, !flag_quiet); > } else > aLog(D_INFO, "Stay in debug mode...\n"); > >+ if (flag_pid && !flag_nopid) { >+ if (pid_file_name==NULL) pid_file_name=set_string("/var/run/netams.pid"); >+ FILE *pidfile = fopen(pid_file_name, "wt"); >+ >+ if (pidfile!=NULL) { >+ fprintf(pidfile, "%u\n", getpid()); >+ fclose(pidfile); >+ } else { >+ fprintf(stderr, "Can't create pid-file: %s\n", strerror(errno)); >+ } >+ } >+ > // handling signals > signal(SIGHUP, (sig_t)logrotate); > signal(SIGQUIT, (sig_t)termination); >diff -Naur src.orig/netamsctl.c src/netamsctl.c >--- src.orig/netamsctl.c 2005-01-17 16:13:21 +0300 >+++ src/netamsctl.c 2005-04-11 13:49:39 +0400 >@@ -47,8 +47,6 @@ > sprintf(str, "%s/.netamsctl.rc", homedir); > RCFILE=fopen(str, "rt"); > } >- if (!RCFILE) RCFILE=fopen(".netamsctl.rc", "rt"); >- if (!RCFILE) RCFILE=fopen("/usr/local/etc/.netamsctl.rc", "rt"); > if (!RCFILE) RCFILE=fopen("/etc/.netamsctl.rc", "rt"); > if (!RCFILE) { printf("unable to open .rc file\n"); exit(-1); } > } >diff -Naur src.orig/netams.h src/netams.h >--- src.orig/netams.h 2005-03-17 21:05:38 +0300 >+++ src/netams.h 2005-04-11 13:49:39 +0400 >@@ -14,7 +14,7 @@ > > #include "config.h" > >-#define RUN_PATH "/var/netams" >+#define RUN_PATH "/var/lib/netams" > > // Includes of local definitions > class Connection;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 6606
: 834