Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267553AbUJGSBO (ORCPT ); Thu, 7 Oct 2004 14:01:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267551AbUJGSAE (ORCPT ); Thu, 7 Oct 2004 14:00:04 -0400 Received: from 168.imtp.Ilyichevsk.Odessa.UA ([195.66.192.168]:48654 "HELO port.imtp.ilyichevsk.odessa.ua") by vger.kernel.org with SMTP id S267702AbUJGRt0 (ORCPT ); Thu, 7 Oct 2004 13:49:26 -0400 From: Denis Vlasenko To: Ian Kent Subject: [PATCH] make automounter runnable in foreground and add stderr logging Date: Thu, 7 Oct 2004 20:49:17 +0300 User-Agent: KMail/1.5.4 Cc: LKML MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_dGYZB4He+P2f4V+" Message-Id: <200410072049.18059.vda@port.imtp.ilyichevsk.odessa.ua> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 24768 Lines: 792 --Boundary-00=_dGYZB4He+P2f4V+ Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Ian, I want to debug some automounter problems, but first I need to make automount debugging easier. These patches are against http://kernel.org/pub/linux/daemons/autofs/v4/autofs-4.1.3.tar.bz2 + + http://kernel.org/pub/linux/daemons/autofs/v4/.*patch 1.exec.patch: allow to locate mount et al via $PATH (because I want eventually to stop hardcoding mount path into automount binary). 2.fg.patch: add -f --foreground option which prevents automount from daemonizing (I need it in order to run automount under daemontools). Improve usage() output. 24.syslog.patch add -s --stderr option which makes automounter send all log output to stderr, fix resulting breakage. Ligntly run tested. Please comment/apply. PS: is there a reason why automount does this? /* include/config.h. Generated by configure. */ #define PATH_MOUNT "/usr/bin/mount" #define PATH_UMOUNT "/usr/bin/umount" #define PATH_E2FSCK "/usr/bin/fsck.ext2" #define PATH_E3FSCK "/usr/bin/fsck.ext3" We have $PATH for ages... -- vda --Boundary-00=_dGYZB4He+P2f4V+ Content-Type: text/x-diff; charset="koi8-r"; name="1.exec.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="1.exec.patch" diff -urpN autofs-4.1.3.orig/daemon/spawn.c autofs-4.1.3_1.exec/daemon/spawn.c --- autofs-4.1.3.orig/daemon/spawn.c Thu Jan 29 18:01:22 2004 +++ autofs-4.1.3_1.exec/daemon/spawn.c Thu Oct 7 18:05:20 2004 @@ -169,7 +169,7 @@ int spawnv(int logpri, const char *lockf retries--; } } - execv(prog, (char *const *) argv); + execvp(prog, (char *const *) argv); _exit(255); /* execv() failed */ } else { /* Careful here -- if we enable SIGCHLD yet we may not receive the diff -urpN autofs-4.1.3.orig/modules/lookup_program.c autofs-4.1.3_1.exec/modules/lookup_program.c --- autofs-4.1.3.orig/modules/lookup_program.c Thu Jan 29 18:01:22 2004 +++ autofs-4.1.3_1.exec/modules/lookup_program.c Thu Oct 7 18:05:09 2004 @@ -131,7 +131,7 @@ int lookup_mount(const char *root, const dup2(epipefd[1], STDERR_FILENO); close(pipefd[1]); close(epipefd[1]); - execl(ctxt->mapname, ctxt->mapname, name, NULL); + execlp(ctxt->mapname, ctxt->mapname, name, NULL); _exit(255); /* execl() failed */ } close(pipefd[1]); diff -urpN autofs-4.1.3.orig/modules/mount_autofs.c autofs-4.1.3_1.exec/modules/mount_autofs.c --- autofs-4.1.3.orig/modules/mount_autofs.c Sun Mar 7 14:17:54 2004 +++ autofs-4.1.3_1.exec/modules/mount_autofs.c Thu Oct 7 18:04:41 2004 @@ -154,7 +154,7 @@ int mount_mount(const char *root, const goto error; } else if (slave == 0) { /* Slave process */ - execv(PATH_AUTOMOUNT, argv); + execvp(PATH_AUTOMOUNT, argv); _exit(255); } --Boundary-00=_dGYZB4He+P2f4V+ Content-Type: text/x-diff; charset="koi8-r"; name="2.fg.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.fg.patch" diff -urpN autofs-4.1.3_1.exec/daemon/automount.c autofs-4.1.3_2.fg/daemon/automount.c --- autofs-4.1.3_1.exec/daemon/automount.c Mon Apr 5 16:14:10 2004 +++ autofs-4.1.3_2.fg/daemon/automount.c Thu Oct 7 20:28:27 2004 @@ -61,6 +61,7 @@ static int submount = 0; int do_verbose = 0; /* Verbose feedback option */ int do_debug = 0; /* Enable full debug output */ +int daemonize = 1; /* Shall we daemonize? */ sigset_t ready_sigs; /* signals only accepted in ST_READY */ sigset_t lock_sigs; /* signals blocked for locking */ @@ -1274,7 +1275,7 @@ static void become_daemon(void) chdir("/"); /* Detach from foreground process */ - if (!submount) { + if (!submount && daemonize) { pid = fork(); if (pid > 0) exit(0); @@ -1292,7 +1293,7 @@ static void become_daemon(void) my_pid = getpid(); /* Make our own process group for "magic" reason: processes that share - our pgrp see the raw filesystem behine the magic. So if we are a + our pgrp see the raw filesystem behind the magic. So if we are a submount, don't change -- otherwise we won't be able to actually perform the mount. A pgrp is also useful for controlling all the child processes we generate. */ @@ -1313,7 +1314,7 @@ static void become_daemon(void) crit("redirecting file descriptors failed: %m"); exit(1); } - close(nullfd); + if (nullfd > 2) close(nullfd); /* Write pid file if requested */ if (pid_file) { @@ -1365,7 +1366,19 @@ static unsigned long getnumopt(char *str static void usage(void) { - fprintf(stderr, "Usage: %s [options] path map_type [args...]\n", program); + fprintf(stderr, + "Usage: %s [options] path map_type [args...]\n" + " -h --help this text\n" + " -p --pid-file f write process id to file f\n" + " -t --timeout n auto-unmount in n seconds (0-disable)\n" + " -f --foreground do not daemonize\n" + " -v --verbose be verbose\n" + " -d --debug be even more verbose\n" + " -V --version print version and exit\n" + /* " -g --ghost \n" */ + /* " --submount \n" */ + , program + ); } static void setup_signals(__sighandler_t event_handler, __sighandler_t cld_handler) @@ -1650,6 +1663,7 @@ int main(int argc, char *argv[]) {"help", 0, 0, 'h'}, {"pid-file", 1, 0, 'p'}, {"timeout", 1, 0, 't'}, + {"foreground", 0, 0, 'f'}, {"verbose", 0, 0, 'v'}, {"debug", 0, 0, 'd'}, {"version", 0, 0, 'V'}, @@ -1666,7 +1680,7 @@ int main(int argc, char *argv[]) ap.type = LKP_INDIRECT; opterr = 0; - while ((opt = getopt_long(argc, argv, "+hp:t:vdVg", long_options, NULL)) != EOF) { + while ((opt = getopt_long(argc, argv, "+hp:t:fvdVg", long_options, NULL)) != EOF) { switch (opt) { case 'h': usage(); @@ -1678,6 +1692,10 @@ int main(int argc, char *argv[]) case 't': ap.exp_timeout = getnumopt(optarg, opt); + break; + + case 'f': + daemonize = 0; break; case 'v': --Boundary-00=_dGYZB4He+P2f4V+ Content-Type: text/x-diff; charset="koi8-r"; name="24.syslog.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="24.syslog.patch" diff -urpN autofs-4.1.3_2.fg/daemon/automount.c autofs-4.1.3_4.syslog/daemon/automount.c --- autofs-4.1.3_2.fg/daemon/automount.c Thu Oct 7 20:28:27 2004 +++ autofs-4.1.3_4.syslog/daemon/automount.c Thu Oct 7 20:28:23 2004 @@ -40,7 +40,7 @@ #include #ifndef NDEBUG -#define assert(x) do { if (!(x)) { syslog(LOG_CRIT, __FILE__ ":%d: assertion failed: " #x, __LINE__); } } while(0) +#define assert(x) do { if (!(x)) { crit(__FILE__ ":%d: assertion failed: " #x, __LINE__); } } while(0) #else #define assert(x) do { } while(0) #endif @@ -63,6 +63,8 @@ int do_verbose = 0; /* Verbose feedback int do_debug = 0; /* Enable full debug output */ int daemonize = 1; /* Shall we daemonize? */ +int log_stderr; /* Use stderr instead of syslog? */ + sigset_t ready_sigs; /* signals only accepted in ST_READY */ sigset_t lock_sigs; /* signals blocked for locking */ sigset_t sigchld_mask; @@ -159,7 +161,7 @@ static int umount_ent(const char *root, if (umount_ok || is_smbfs) { wait_for_lock(); - rv = spawnl(LOG_DEBUG, MOUNTED_LOCK, + rv = spawnl(debug, MOUNTED_LOCK, PATH_UMOUNT, PATH_UMOUNT, path_buf, NULL); unlink(AUTOFS_LOCK); } @@ -351,13 +353,13 @@ static int do_umount_autofs(void) int ret; wait_for_lock(); - rv = spawnl(LOG_DEBUG, MOUNTED_LOCK, + rv = spawnl(debug, MOUNTED_LOCK, PATH_UMOUNT, PATH_UMOUNT, ap.path, NULL); if (rv & MTAB_NOTUPDATED) { info("umount %s succeeded: " "mtab not updated, retrying to clean\n", ap.path); - rv = spawnl(LOG_DEBUG, MOUNTED_LOCK, + rv = spawnl(debug, MOUNTED_LOCK, PATH_UMOUNT, PATH_UMOUNT, ap.path, NULL); } unlink(AUTOFS_LOCK); @@ -467,7 +469,7 @@ static int mount_autofs(char *path) our_name[len] = '\0'; wait_for_lock(); - if (spawnl(LOG_DEBUG, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, + if (spawnl(debug, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", "autofs", "-o", options, our_name, path, NULL) != 0) { crit("failed to mount autofs path %s", ap.path); unlink(AUTOFS_LOCK); @@ -561,7 +563,7 @@ static int send_fail(unsigned int wait_q return 0; debug("send_fail: token=%d\n", wait_queue_token); if (ioctl(ap.ioctlfd, AUTOFS_IOC_FAIL, wait_queue_token) < 0) { - syslog(LOG_ERR, "AUTOFS_IOC_FAIL: %m"); + error("AUTOFS_IOC_FAIL: %m"); return 1; } return 0; @@ -691,7 +693,7 @@ static void sig_child(int sig) static int st_ready(void) { - debug("st_ready(): state = %d\n", ap.state); + debug("st_ready(): state = %d", ap.state); ap.state = ST_READY; sigprocmask(SIG_UNBLOCK, &lock_sigs, NULL); @@ -823,7 +825,7 @@ static int st_prepare_shutdown(void) { int exp; - DB(syslog(LOG_INFO, "prep_shutdown: state = %d\n", ap.state)); + DB(info("prep_shutdown: state = %d", ap.state)); assert(ap.state == ST_READY || ap.state == ST_EXPIRE); @@ -862,7 +864,7 @@ static int st_prepare_shutdown(void) static int st_prune(void) { - debug("st_prune(): state = %d\n", ap.state); + debug("st_prune(): state = %d", ap.state); assert(ap.state == ST_READY); @@ -886,7 +888,7 @@ static int st_prune(void) static int st_expire(void) { - debug("st_expire(): state = %d\n", ap.state); + debug("st_expire(): state = %d", ap.state); assert(ap.state == ST_READY); @@ -958,7 +960,7 @@ static int get_pkt(int fd, union autofs_ if (poll(fds, 2, -1) == -1) { if (errno == EINTR) continue; - syslog(LOG_ERR, "get_pkt: poll failed: %m"); + error("get_pkt: poll failed: %s", strerror(errno)); return -1; } @@ -1269,7 +1271,6 @@ static void become_daemon(void) { FILE *pidfp; pid_t pid; - int nullfd; /* Don't BUSY any directories unnecessarily */ chdir("/"); @@ -1285,9 +1286,12 @@ static void become_daemon(void) exit(1); } } - - /* Open syslog */ - openlog("automount", LOG_PID, LOG_DAEMON); + /* Initialize logging subsystem */ + if(!log_stderr) { + log_to_syslog(); + } else { + log_to_stderr(); + } /* Initialize global data */ my_pid = getpid(); @@ -1303,19 +1307,6 @@ static void become_daemon(void) } my_pgrp = getpgrp(); - /* Redirect all our file descriptors to /dev/null */ - if ((nullfd = open("/dev/null", O_RDWR)) < 0) { - crit("cannot open /dev/null: %m"); - exit(1); - } - - if (dup2(nullfd, STDIN_FILENO) < 0 || - dup2(nullfd, STDOUT_FILENO) < 0 || dup2(nullfd, STDERR_FILENO) < 0) { - crit("redirecting file descriptors failed: %m"); - exit(1); - } - if (nullfd > 2) close(nullfd); - /* Write pid file if requested */ if (pid_file) { if ((pidfp = fopen(pid_file, "wt"))) { @@ -1372,6 +1363,7 @@ static void usage(void) " -p --pid-file f write process id to file f\n" " -t --timeout n auto-unmount in n seconds (0-disable)\n" " -f --foreground do not daemonize\n" + " -s --stderr log to stderr instead of syslog\n" " -v --verbose be verbose\n" " -d --debug be even more verbose\n" " -V --version print version and exit\n" @@ -1664,6 +1656,7 @@ int main(int argc, char *argv[]) {"pid-file", 1, 0, 'p'}, {"timeout", 1, 0, 't'}, {"foreground", 0, 0, 'f'}, + {"stderr", 0, 0, 's'}, {"verbose", 0, 0, 'v'}, {"debug", 0, 0, 'd'}, {"version", 0, 0, 'V'}, @@ -1680,7 +1673,7 @@ int main(int argc, char *argv[]) ap.type = LKP_INDIRECT; opterr = 0; - while ((opt = getopt_long(argc, argv, "+hp:t:fvdVg", long_options, NULL)) != EOF) { + while ((opt = getopt_long(argc, argv, "+hp:t:fsvdVg", long_options, NULL)) != EOF) { switch (opt) { case 'h': usage(); @@ -1698,6 +1691,10 @@ int main(int argc, char *argv[]) daemonize = 0; break; + case 's': + log_stderr = 1; + break; + case 'v': do_verbose = 1; break; @@ -1749,9 +1746,9 @@ int main(int argc, char *argv[]) #ifdef DEBUG if (mapargc) { int i; - syslog(LOG_DEBUG, "Map argc = %d", mapargc); + debug("Map argc = %d", mapargc); for (i = 0; i < mapargc; i++) - syslog(LOG_DEBUG, "Map argv[%d] = %s", i, mapargv[i]); + debug("Map argv[%d] = %s", i, mapargv[i]); } #endif diff -urpN autofs-4.1.3_2.fg/daemon/spawn.c autofs-4.1.3_4.syslog/daemon/spawn.c --- autofs-4.1.3_2.fg/daemon/spawn.c Thu Oct 7 18:05:20 2004 +++ autofs-4.1.3_4.syslog/daemon/spawn.c Thu Oct 7 19:48:17 2004 @@ -130,7 +130,7 @@ void wait_for_lock(void) #define ERRBUFSIZ 2047 /* Max length of error string excl \0 */ -int spawnv(int logpri, const char *lockf, const char *prog, const char *const *argv) +int spawnv(logger* log, const char *lockf, const char *prog, const char *const *argv) { pid_t f; int status, pipefd[2]; @@ -201,7 +201,7 @@ int spawnv(int logpri, const char *lockf while (errp && (p = memchr(sp, '\n', errp))) { *p++ = '\0'; if (sp[0]) /* Don't output empty lines */ - syslog(logpri, ">> %s", sp); + log(">> %s", sp); errp -= (p - sp); sp = p; } @@ -212,7 +212,7 @@ int spawnv(int logpri, const char *lockf if (errp >= ERRBUFSIZ) { /* Line too long, split */ errbuf[errp] = '\0'; - syslog(logpri, ">> %s", errbuf); + log(">> %s", errbuf); errp = 0; } } @@ -222,7 +222,7 @@ int spawnv(int logpri, const char *lockf if (errp > 0) { /* End of file without \n */ errbuf[errp] = '\0'; - syslog(logpri, ">> %s", errbuf); + log(">> %s", errbuf); } if (waitpid(f, &status, 0) != f) @@ -234,7 +234,7 @@ int spawnv(int logpri, const char *lockf } } -int spawnl(int logpri, const char *lockf, const char *prog, ...) +int spawnl(logger* log, const char *lockf, const char *prog, ...) { va_list arg; int argc; @@ -252,5 +252,5 @@ int spawnl(int logpri, const char *lockf while ((*p++ = va_arg(arg, char *))); va_end(arg); - return spawnv(logpri, lockf, prog, (const char **) argv); + return spawnv(log, lockf, prog, (const char **) argv); } diff -urpN autofs-4.1.3_2.fg/include/automount.h autofs-4.1.3_4.syslog/include/automount.h --- autofs-4.1.3_2.fg/include/automount.h Tue May 18 15:20:08 2004 +++ autofs-4.1.3_4.syslog/include/automount.h Thu Oct 7 19:56:28 2004 @@ -113,11 +113,28 @@ struct autofs_point { int state_pipe[2]; }; +/* log notification */ + +extern int do_verbose; +extern int do_debug; + +typedef void logger(const char* msg, ...); + +extern void (*info)(const char* msg, ...); +extern void (*notice)(const char* msg, ...); +extern void (*warn)(const char* msg, ...); +extern void (*error)(const char* msg, ...); +extern void (*crit)(const char* msg, ...); +extern void (*debug)(const char* msg, ...); + +void log_to_syslog(); +void log_to_stderr(); + /* Standard function used by daemon or modules */ void wait_for_lock(void); -int spawnl(int logpri, const char *lockf, const char *prog, ...); -int spawnv(int logpri, const char *lockf, const char *prog, const char *const *argv); +int spawnl(logger* log, const char *lockf, const char *prog, ...); +int spawnv(logger* log, const char *lockf, const char *prog, const char *const *argv); void reset_signals(void); void ignore_signals(void); void discard_pending(int sig); @@ -252,24 +269,5 @@ int rpc_time(const char *host, unsigned int ping_vers, unsigned int ping_proto, long seconds, long micros, double *result); -/* log notification */ -extern int do_verbose; -extern int do_debug; - -#define info(msg, args...) \ -if (do_verbose || do_debug) \ - syslog(LOG_INFO, msg, ##args); - -#define warn(msg, args...) \ -if (do_verbose || do_debug) \ - syslog(LOG_WARNING, msg, ##args); - -#define error(msg, args...) syslog(LOG_ERR, msg, ##args); - -#define crit(msg, args...) syslog(LOG_CRIT, msg, ##args); - -#define debug(msg, args...) \ -if (do_debug) \ - syslog(LOG_DEBUG, msg, ##args); #endif diff -urpN autofs-4.1.3_2.fg/lib/Makefile autofs-4.1.3_4.syslog/lib/Makefile --- autofs-4.1.3_2.fg/lib/Makefile Sun Mar 7 14:17:54 2004 +++ autofs-4.1.3_4.syslog/lib/Makefile Thu Oct 7 18:56:39 2004 @@ -11,7 +11,7 @@ RANLIB = /usr/bin/ranlib SRCS = cache.c listmount.c cat_path.c rpc_subs.c RPCS = mount.h mount_clnt.c mount_xdr.c -OBJS = cache.o mount_clnt.o mount_xdr.o listmount.o cat_path.o rpc_subs.o +OBJS = cache.o mount_clnt.o mount_xdr.o listmount.o cat_path.o rpc_subs.o log.o LIB = autofs.a @@ -46,6 +46,10 @@ mount_xdr.o: mount_xdr.c listmount.o: listmount.c $(CC) $(CFLAGS) -o listmount.o -c listmount.c $(STRIP) listmount.o + +log.o: log.c + $(CC) $(CFLAGS) -o log.o -c log.c + $(STRIP) log.o install: all diff -urpN autofs-4.1.3_2.fg/lib/log.c autofs-4.1.3_4.syslog/lib/log.c --- autofs-4.1.3_2.fg/lib/log.c Thu Jan 1 03:00:00 1970 +++ autofs-4.1.3_4.syslog/lib/log.c Thu Oct 7 20:21:21 2004 @@ -0,0 +1,116 @@ +#include +#include +#include +#include +#include /* open() */ +#include /* exit() */ + +#include "automount.h" + +static void null(const char *msg, ...) +{ +} + +void (*info)(const char* msg, ...) = null; +void (*notice)(const char* msg, ...) = null; +void (*warn)(const char* msg, ...) = null; +void (*error)(const char* msg, ...) = null; +void (*crit)(const char* msg, ...) = null; +void (*debug)(const char* msg, ...) = null; + +static void syslog_debug(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + syslog(LOG_DEBUG, msg, ap); + va_end(ap); +} + +static void syslog_info(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + syslog(LOG_INFO, msg, ap); + va_end(ap); +} + +static void syslog_notice(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + syslog(LOG_NOTICE, msg, ap); + va_end(ap); +} + +static void syslog_warn(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + syslog(LOG_WARNING, msg, ap); + va_end(ap); +} + +static void syslog_err(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + syslog(LOG_ERR, msg, ap); + va_end(ap); +} + +static void syslog_crit(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + syslog(LOG_CRIT, msg, ap); + va_end(ap); +} + +static void to_stderr(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + vfprintf(stderr, msg, ap); + fputc('\n',stderr); + va_end(ap); +} + +void log_to_syslog() +{ + int nullfd; + + openlog("automount", LOG_PID, LOG_DAEMON); + if (do_debug) debug = syslog_debug; + if (do_verbose || do_debug) { + info = syslog_info; + notice = syslog_notice; + warn = syslog_warn; + } + error = syslog_err; + crit = syslog_crit; + + /* Redirect all our file descriptors to /dev/null */ + nullfd = open("/dev/null", O_RDWR); + if (nullfd < 0) { + crit("cannot open /dev/null: %m"); + exit(1); + } + if (dup2(nullfd, STDIN_FILENO) < 0 || + dup2(nullfd, STDOUT_FILENO) < 0 || dup2(nullfd, STDERR_FILENO) < 0) { + crit("redirecting file descriptors failed: %"); + exit(1); + } + if (nullfd > 2) close(nullfd); +} + +void log_to_stderr() +{ + if (do_debug) debug = to_stderr; + if (do_verbose || do_debug) { + info = to_stderr; + notice = to_stderr; + warn = to_stderr; + } + error = to_stderr; + crit = to_stderr; +} diff -urpN autofs-4.1.3_2.fg/modules/mount_bind.c autofs-4.1.3_4.syslog/modules/mount_bind.c --- autofs-4.1.3_2.fg/modules/mount_bind.c Mon May 10 15:44:30 2004 +++ autofs-4.1.3_4.syslog/modules/mount_bind.c Thu Oct 7 20:23:13 2004 @@ -61,7 +61,7 @@ int mount_init(void **context) if (lstat(tmp1, &st1) == -1) goto out; - err = spawnl(LOG_DEBUG, MOUNTED_LOCK, + err = spawnl(debug, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-n", "--bind", tmp1, tmp2, NULL); if (err == 0 && @@ -70,8 +70,8 @@ int mount_init(void **context) bind_works = 1; } - debug(MODPREFIX "bind_works = %d\n", bind_works); - spawnl(LOG_DEBUG, MOUNTED_LOCK, + debug(MODPREFIX "bind_works = %d", bind_works); + spawnl(debug, MOUNTED_LOCK, PATH_UMOUNT, PATH_UMOUNT, "-n", tmp2, NULL); out: @@ -124,7 +124,7 @@ int mount_mount(const char *root, const debug(MODPREFIX "calling mount --bind %s %s", what, fullpath); wait_for_lock(); - err = spawnl(LOG_NOTICE, MOUNTED_LOCK, + err = spawnl(notice, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "--bind", what, fullpath, NULL); unlink(AUTOFS_LOCK); diff -urpN autofs-4.1.3_2.fg/modules/mount_changer.c autofs-4.1.3_4.syslog/modules/mount_changer.c --- autofs-4.1.3_2.fg/modules/mount_changer.c Mon May 10 15:44:30 2004 +++ autofs-4.1.3_4.syslog/modules/mount_changer.c Thu Oct 7 19:51:12 2004 @@ -70,7 +70,7 @@ int mount_mount(const char *root, const debug(MODPREFIX "calling umount %s", what); wait_for_lock(); - err = spawnl(LOG_DEBUG, MOUNTED_LOCK, + err = spawnl(debug, MOUNTED_LOCK, PATH_UMOUNT, PATH_UMOUNT, what, NULL); unlink(AUTOFS_LOCK); if (err) { @@ -98,14 +98,14 @@ int mount_mount(const char *root, const debug(MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s", fstype, options, what, fullpath); - err = spawnl(LOG_DEBUG, MOUNTED_LOCK, + err = spawnl(debug, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", fstype, SLOPPYOPT "-o", options, what, fullpath, NULL); } else { debug(MODPREFIX "calling mount -t %s %s %s", fstype, what, fullpath); - err = spawnl(LOG_DEBUG, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, + err = spawnl(debug, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", fstype, what, fullpath, NULL); } unlink(AUTOFS_LOCK); diff -urpN autofs-4.1.3_2.fg/modules/mount_ext2.c autofs-4.1.3_4.syslog/modules/mount_ext2.c --- autofs-4.1.3_2.fg/modules/mount_ext2.c Mon May 10 15:44:30 2004 +++ autofs-4.1.3_4.syslog/modules/mount_ext2.c Thu Oct 7 19:50:36 2004 @@ -91,10 +91,10 @@ int mount_mount(const char *root, const #endif if (ro) { debug(MODPREFIX "calling %s -n %s", fsck_prog, what); - err = spawnl(LOG_DEBUG, MOUNTED_LOCK, fsck_prog, fsck_prog, "-n", what, NULL); + err = spawnl(debug, MOUNTED_LOCK, fsck_prog, fsck_prog, "-n", what, NULL); } else { debug(MODPREFIX "calling %s -p %s", fsck_prog, what); - err = spawnl(LOG_DEBUG, MOUNTED_LOCK, fsck_prog, fsck_prog, "-p", what, NULL); + err = spawnl(debug, MOUNTED_LOCK, fsck_prog, fsck_prog, "-p", what, NULL); } if (err & ~6) { @@ -107,13 +107,13 @@ int mount_mount(const char *root, const if (options) { debug(MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s", fstype, options, what, fullpath); - err = spawnl(LOG_NOTICE, MOUNTED_LOCK, + err = spawnl(notice, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", fstype, SLOPPYOPT "-o", options, what, fullpath, NULL); } else { debug(MODPREFIX "calling mount -t %s %s %s", fstype, what, fullpath); - err = spawnl(LOG_NOTICE, MOUNTED_LOCK, + err = spawnl(notice, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", fstype, what, fullpath, NULL); } diff -urpN autofs-4.1.3_2.fg/modules/mount_generic.c autofs-4.1.3_4.syslog/modules/mount_generic.c --- autofs-4.1.3_2.fg/modules/mount_generic.c Mon May 10 15:44:30 2004 +++ autofs-4.1.3_4.syslog/modules/mount_generic.c Thu Oct 7 19:51:27 2004 @@ -76,13 +76,13 @@ int mount_mount(const char *root, const debug(MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s", fstype, options, what, fullpath); - err = spawnl(LOG_NOTICE, MOUNTED_LOCK, + err = spawnl(notice, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", fstype, SLOPPYOPT "-o", options, what, fullpath, NULL); } else { debug(MODPREFIX "calling mount -t %s %s %s", fstype, what, fullpath); - err = spawnl(LOG_NOTICE, MOUNTED_LOCK, + err = spawnl(notice, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", fstype, what, fullpath, NULL); } diff -urpN autofs-4.1.3_2.fg/modules/mount_nfs.c autofs-4.1.3_4.syslog/modules/mount_nfs.c --- autofs-4.1.3_2.fg/modules/mount_nfs.c Tue May 18 15:20:08 2004 +++ autofs-4.1.3_4.syslog/modules/mount_nfs.c Thu Oct 7 19:50:53 2004 @@ -450,14 +450,14 @@ int mount_mount(const char *root, const debug(MODPREFIX "calling mount -t nfs " SLOPPY " -o %s %s %s", nfsoptions, whatstr, fullpath); - err = spawnl(LOG_NOTICE, MOUNTED_LOCK, + err = spawnl(notice, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", "nfs", SLOPPYOPT "-o", nfsoptions, whatstr, fullpath, NULL); } else { debug(MODPREFIX "calling mount -t nfs %s %s", whatstr, fullpath); - err = spawnl(LOG_NOTICE, MOUNTED_LOCK, + err = spawnl(notice, MOUNTED_LOCK, PATH_MOUNT, PATH_MOUNT, "-t", "nfs", whatstr, fullpath, NULL); } --Boundary-00=_dGYZB4He+P2f4V+-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/