On Mon, 28 Sep 2009 15:31:06 +0200 Tomasz Chmielewski <mangoo@xxxxxxxx> wrote: > FUJITA Tomonori wrote: > > The tar is also available: > > > > http://stgt.berlios.de/releases/tgt-0.9.8.tar.bz2 > > With 0.9.8 (and 0.9.9), it is possible to start multiple tgtd processes > - although I'm not sure if it's desired? It's a regression introduced by the commit 501bed190d74a9f745014e48a3d2d780274c0869 (I guess that we will support multiple tgt processes in the future). I'll think about a way to fix this issue properly, but reverting the patch should work. = >From acb4faf9a2fd02cc318bf4b1c04cf5178a7a034b Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> Date: Tue, 29 Sep 2009 09:34:42 +0900 Subject: [PATCH] Revert "fix tgtd startup" This reverts commit 501bed190d74a9f745014e48a3d2d780274c0869. --- usr/log.c | 20 -------------------- usr/tgtd.c | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 34 deletions(-) diff --git a/usr/log.c b/usr/log.c index cf7e905..056314a 100644 --- a/usr/log.c +++ b/usr/log.c @@ -17,7 +17,6 @@ * 02110-1301 USA */ #include <ctype.h> -#include <fcntl.h> #include <string.h> #include <stdarg.h> #include <stdio.h> @@ -28,7 +27,6 @@ #include <errno.h> #include <sys/shm.h> #include <sys/ipc.h> -#include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> @@ -342,7 +340,6 @@ int log_init(char *program_name, int size, int daemon, int debug) if (daemon) { struct sigaction sa_old; struct sigaction sa_new; - int fd; openlog(log_name, 0, LOG_DAEMON); setlogmask (LOG_UPTO (LOG_DEBUG)); @@ -363,23 +360,6 @@ int log_init(char *program_name, int size, int daemon, int debug) return 0; } - fd = open("/dev/null", O_RDWR); - if (fd < 0) { - syslog(LOG_ERR, "failed to open /dev/null: %s\n", - strerror(errno)); - exit(1); - } - - dup2(fd, 0); - dup2(fd, 1); - dup2(fd, 2); - setsid(); - if (chdir("/") < 0) { - syslog(LOG_ERR, "failed to chdir to '/': %s\n", - strerror(errno)); - exit(1); - } - /* flush on daemon's crash */ sa_new.sa_handler = (void*)log_flush; sigemptyset(&sa_new.sa_mask); diff --git a/usr/tgtd.c b/usr/tgtd.c index b07a445..8569d41 100644 --- a/usr/tgtd.c +++ b/usr/tgtd.c @@ -349,7 +349,19 @@ int main(int argc, char **argv) } } - err = log_init(program_name, LOG_SPACE_SIZE, is_daemon, is_debug); + ep_fd = epoll_create(4096); + if (ep_fd < 0) { + fprintf(stderr, "can't create epoll fd, %m\n"); + exit(1); + } + + nr_lld = lld_init(&use_kernel, argv[optind]); + if (!nr_lld) { + fprintf(stderr, "No available low level driver!\n"); + exit(1); + } + + err = ipc_init(); if (err) exit(1); @@ -364,19 +376,7 @@ int main(int argc, char **argv) if (err) exit(1); - ep_fd = epoll_create(4096); - if (ep_fd < 0) { - fprintf(stderr, "can't create epoll fd, %m\n"); - exit(1); - } - - nr_lld = lld_init(&use_kernel, argv[optind]); - if (!nr_lld) { - fprintf(stderr, "No available low level driver!\n"); - exit(1); - } - - err = ipc_init(); + err = log_init(program_name, LOG_SPACE_SIZE, is_daemon, is_debug); if (err) exit(1); -- 1.6.0.6 -- To unsubscribe from this list: send the line "unsubscribe stgt" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html