Glenn Willen | 14 Mar 08:24 2004

Anomalous supervise behavior

First, I apologize if this is not the appropriate list for my question. I
couldn't find a list for daemontools in general, and my question relates to
usage of supervise in conjunction with multilog (though I'm not at all sure
that's relevant.)

I discovered this evening that supervise (a single supervise process),
supervising multilog, was chewing up my entire processor. Restarting supervise
did not help. [Deleting the 'supervise/' directory and restarting it ultimately
did fix the problem.] Strace showed that poll() claimed data was present on
fd6, but read() on fd6 was reading 0 bytes each time. I would like to know, for
personal curiosity and future reference, what could possibly cause this strange
behavior? Thanks in advance for your help.

[Below is the output of strace, showing two iterations of the loop in supervise.
Since I know this is going to get linewrap-mangled, I will compensate badly by
indenting line continuations.]

poll([{fd=3, events=POLLIN}, {fd=6, events=POLLIN, revents=POLLIN}], 2, 
    1000020) = 1
rt_sigprocmask(SIG_BLOCK, [CHLD], NULL, 8) = 0
read(3, 0xbffffdcf, 1)                  = -1 EAGAIN (Resource temporarily 
    unavailable)
wait4(-1, 0xbffffdc8, WNOHANG, NULL)    = 0
read(6, "", 1)                          = 0
rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
gettimeofday({1079247065, 508374}, NULL) = 0
poll([{fd=3, events=POLLIN}, {fd=6, events=POLLIN, revents=POLLIN}], 2, 
    1000020) = 1
rt_sigprocmask(SIG_BLOCK, [CHLD], NULL, 8) = 0
read(3, 0xbffffdcf, 1)                  = -1 EAGAIN (Resource temporarily 
(Continue reading)

Peter Wolfenden | 26 Feb 04:43 2004

Work around rpm deadlocking with "setlock2"

Hello,

I've been using the daemontools package for over a year now,
and have found it very valuable both for building trustworthy
software on our in-house linux platforms and for implementing
workarounds for broken software that comes from out-of-house.

For example, I recently ran into a deadlocking problem with the
'rpm' program, which we use to manage software on our in-house
linux machines. Unfortunately, RedHat doesn't seem anxious to
fix the problem - details are online:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=115152
But this one-line bash script "wraps" the rpm binary with a call
to setlock that prevents multiple processes from attempting to
call rpm at the same time, preventing the deadlock:

  #!/bin/bash
  setlock /tmp/.rpm_lock /bin/rpm "$ <at> "

All our in-house systems have an rpm user which owns the local
rpm database, and a user must belong to the rpm group in order
to run rpm commands. So the first security improvement to the
bash wrapper looks like this:

  #!/bin/bash
  if [ root = `/usr/bin/whoami` ]; then
    /usr/local/bin/setuidgid rpm /usr/local/bin/setlock \
      /var/run/.rpm_lock /bin/rpm "$ <at> "
  else
    /usr/local/bin/setlock /var/run/.rpm_lock /bin/rpm "$ <at> "
(Continue reading)

Awie | 19 Feb 09:37 2004

Error in readproctitle

All,
 
** Sorry to send in HTML  format, it is for highlight the lines below
 
I tried to supervise CLAMD (Clam Antivirus Daemon). It seems run well, but I found error in readproctitle. I assume that CLAMD be loaded more than once. Please correct me
 
Your answer is very appreciated and waited for

Thx & Rgds,
 
Awie
 
 
===== SNIP ======
 
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.6  0.1  1388  504 ?        S    16:13   0:04 init [3]
root         2  0.0  0.0     0    0 ?        SW   16:13   0:00 [keventd]
root         3  0.0  0.0     0    0 ?        SWN  16:13   0:00 [ksoftirqd_CPU0]
root         4  0.0  0.0     0    0 ?        SW   16:13   0:00 [kswapd]
root         5  0.0  0.0     0    0 ?        SW   16:13   0:00 [bdflush]
root         6  0.0  0.0     0    0 ?        SW   16:13   0:00 [kupdated]
root         7  0.0  0.0     0    0 ?        SW   16:13   0:00 [kjournald]
root       609  0.0  0.0     0    0 ?        SW   16:13   0:00 [kjournald]
root       964  0.0  0.2  1460  604 ?        S    16:13   0:00 syslogd -m 0
root       968  0.0  0.1  1388  460 ?        S    16:13   0:00 klogd -x
root      1004  0.0  0.5  3520 1520 ?        S    16:13   0:00 /usr/sbin/sshd
root      1026  0.0  0.2  1440  600 ?        S    16:13   0:00 crond
root      1090  0.0  0.3  3624  996 ?        S    16:13   0:00 /usr/local/squid/sbin/squid
root      1091  0.0  0.1  1364  368 tty1     S    16:13   0:00 /sbin/mingetty tty1
root      1092  0.0  0.1  1364  368 tty2     S    16:13   0:00 /sbin/mingetty tty2
root      1093  0.0  0.1  1364  368 tty3     S    16:13   0:00 /sbin/mingetty tty3
root      1094  0.0  0.3  2120 1024 ?        S    16:13   0:00 /bin/sh /command/svscanboot
nobody    1096  0.0  3.1  9708 7976 ?        S    16:13   0:00 (squid)
nobody    1097  0.1  0.4  2080 1164 ?        S    16:13   0:01 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
nobody    1098  0.1  0.4  2016 1100 ?        S    16:13   0:00 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
nobody    1099  0.1  0.3  1988 1008 ?        S    16:13   0:00 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
nobody    1100  0.1  0.3  1988 1008 ?        S    16:13   0:00 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
nobody    1101  0.1  0.3  1988 1008 ?        S    16:13   0:01 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
root      1103  0.0  0.1  1400  320 ?        S    16:13   0:00 svscan /service
root      1104  0.0  0.0  1356  228 ?        S    16:13   0:00 readproctitle service errors: ...already running!?Exiting!?Error: 1 c
root      1105  0.0  0.1  1364  276 ?        S    16:13   0:00 supervise dnscache
root      1106  0.0  0.1  1364  276 ?        S    16:13   0:00 supervise log
root      1107  0.0  0.1  1364  276 ?        S    16:13   0:00 supervise qmail-send
root      1108  0.0  0.1  1364  276 ?        S    16:13   0:00 supervise log
nobody    1109  0.0  0.1  1356  272 ?        S    16:13   0:00 (unlinkd)
root      1110  0.0  0.1  1364  276 ?        S    16:13   0:00 supervise qmail-smtpd
root      1111  0.0  0.1  1364  276 ?        S    16:13   0:00 supervise log
root      1112  0.0  0.1  1364  280 ?        S    16:13   0:00 supervise clamd
root      1113  0.0  0.1  1364  276 ?        S    16:13   0:00 supervise log
dnscache  1114  0.0  3.9 11456 10164 ?       S    16:13   0:00 /usr/local/bin/dnscache
dnslog    1115  0.0  0.1  1376  272 ?        S    16:13   0:00 multilog t ./main
qmails    1116  0.0  0.1  1412  352 ?        S    16:13   0:00 qmail-send
qmaill    1118  0.0  0.1  1376  272 ?        S    16:13   0:00 /usr/local/bin/multilog t /var/log/qmail
root      1119  0.0  0.1  1376  296 ?        S    16:13   0:00 qmail-lspawn ./Mailbox
qmailr    1120  0.0  0.1  1372  296 ?        S    16:13   0:00 qmail-rspawn
qmailq    1121  0.0  0.1  1368  308 ?        S    16:13   0:00 qmail-clean
qmaild    1128  0.0  0.1  1436  476 ?        S    16:13   0:00 /usr/local/bin/tcpserver -v -R -H -l 0 -x /etc/tcp.smtp.cdb -c 20 -u
qmaill    1129  0.0  0.1  1376  272 ?        S    16:13   0:00 /usr/local/bin/multilog t /var/log/qmail/smtpd
qscand    1130  0.0  0.1  1376  264 ?        S    16:13   0:00 /usr/local/bin/multilog t s1000000 n20 /var/log/clamd
qscand    1134  0.0  4.7 15684 12260 ?       S    16:13   0:00 /usr/local/sbin/clamd
root      1872  0.0  0.8  6792 2088 ?        S    16:15   0:00 /usr/sbin/sshd
root      1923  0.0  0.5  4320 1412 pts/0    S    16:15   0:00 -bash
root      5405  0.0  0.0     0    0 ?        Z    16:23   0:00 [run <defunct>]
root      5412  0.0  0.2  2652  712 pts/0    R    16:23   0:00 ps -auxw
 
SW | 23 Dec 22:19 2003
Picon
Picon

cp: cannot stat `compile/svscan': No such file or directory

Hi,

I am new to this list, first time trying to install daemontools.

I appreciate if you can let me know what I do wrong here,

Here is the log wile running package/install

[root <at> localhost package]# cd ..
[root <at> localhost daemontools-0.76]# package/install
Linking ./src/* into ./compile...
Compiling everything in ./compile...
./load envdir unix.a byte.a
envdir.o(.text+0xca): In function `main':
: undefined reference to `errno'
envdir.o(.text+0x1ea): In function `main':
: undefined reference to `errno'
unix.a(openreadclose.o)(.text+0x3b): In function `openreadclose':
: undefined reference to `errno'
unix.a(pathexec_run.o)(.text+0xf6): In function `pathexec_run':
: undefined reference to `errno'
unix.a(pathexec_run.o)(.text+0x13a): In function `pathexec_run':
: undefined reference to `errno'
unix.a(readclose.o)(.text+0x42): more undefined references to `errno' follow
collect2: ld returned 1 exit status
make: *** [envdir] Error 1
Copying commands into ./command...
cp: cannot stat `compile/svscan': No such file or directory

Here are the directory content

[root <at> localhost daemontools-0.76]# ls
command  compile  package  src
[root <at> localhost daemontools-0.76]# cd compile
[root <at> localhost compile]# ls
alloc.c         fd.h             open_trunc.c     strerr_die.c
alloc.h         fd_move.c        open_trunc.o     strerr_die.o
alloc.o         fd_move.o        open_write.c     strerr.h
alloc_re.c      fghack.c         open_write.o     strerr_sys.c
alloc_re.o      fifo.c           pathexec_env.c   strerr_sys.o
buffer_0.c      fifo.h           pathexec_env.o   str.h
buffer_0.o      fifo.o           pathexec.h       str_len.c
buffer_1.c      find-systype.sh  pathexec_run.c   str_len.o
buffer_1.o      fmt.h            pathexec_run.o   str_start.c
buffer_2.c      fmt_uint0.c      pgrphack.c       str_start.o
buffer_2.o      fmt_uint0.o      print-ar.sh      subgetopt.c
buffer.c        fmt_uint.c       print-cc.sh      subgetopt.h
buffer_get.c    fmt_uint.o       print-ld.sh      subgetopt.o
buffer_get.o    fmt_ulong.c      prot.c           supervise.c
buffer.h        fmt_ulong.o      prot.h           svc.c
buffer.o        gen_allocdefs.h  prot.o           svok.c
buffer_put.c    gen_alloc.h      readclose.c      svscanboot.sh
buffer_put.o    hasflock.h       readclose.h      svscan.c
buffer_read.c   hasflock.h1      readclose.o      svstat.c
buffer_read.o   hasflock.h2      readproctitle.c  systype
buffer_write.c  hasmkffo.h       rts.tests        tai64n.c
buffer_write.o  hasmkffo.h1      scan.h           tai64nlocal.c
byte.a          hasmkffo.h2      scan_ulong.c     taia_add.c
byte_chr.c      hassgact.h       scan_ulong.o     taia_approx.c
byte_chr.o      hassgact.h1      seek.h           taia_frac.c
byte_copy.c     hassgact.h2      seek_set.c       taia.h
byte_copy.o     hassgprm.h       seek_set.o       taia_less.c
byte_cr.c       hassgprm.h1      select.h1        taia_now.c
byte_cr.o       hassgprm.h2      select.h2        taia_pack.c
byte_diff.c     hasshsgr.h       setlock.c        taia_sub.c
byte_diff.o     hasshsgr.h1      setuidgid.c      taia_uint.c
byte.h          hasshsgr.h2      sgetopt.c        tai.h
byte_rchr.c     haswaitp.h       sgetopt.h        tai_now.c
byte_rchr.o     haswaitp.h1      sgetopt.o        tai_pack.c
CHANGES         haswaitp.h2      sig_block.c      tai_sub.c
chkshsgr        home             sig_block.o      tai_unpack.c
chkshsgr.c      iopause.c        sig.c            timestamp.c
chkshsgr.o      iopause.h1       sig_catch.c      timestamp.h
choose          iopause.h2       sig_catch.o      TODO
choose.sh       load             sig.h            trycpp.c
coe.c           lock_ex.c        sig.o            trydrent.c
coe.h           lock_exnb.c      sig_pause.c      tryflock.c
coe.o           lock_exnb.o      sig_pause.o      trymkffo.c
compile         lock_ex.o        softlimit.c      trypoll.c
conf-cc         lock.h           src              trysgact.c
conf-ld         Makefile         stralloc_catb.c  trysgprm.c
deepsleep.c     makelib          stralloc_catb.o  tryshsgr.c
deepsleep.h     match.c          stralloc_cat.c   trysysel.c
direntry.h      match.h          stralloc_cat.o   tryulong64.c
direntry.h1     matchtest.c      stralloc_cats.c  trywaitp.c
direntry.h2     multilog.c       stralloc_cats.o  uint64.h1
env.c           ndelay.h         stralloc_eady.c  uint64.h2
envdir.c        ndelay_off.c     stralloc_eady.o  unix.a
envdir.o        ndelay_off.o     stralloc.h       wait.h
env.h           ndelay_on.c      stralloc_opyb.c  wait_nohang.c
env.o           ndelay_on.o      stralloc_opyb.o  wait_nohang.o
envuidgid.c     open_append.c    stralloc_opys.c  wait_pid.c
error.c         open_append.o    stralloc_opys.o  wait_pid.o
error.h         open.h           stralloc_pend.c  warn-auto.sh
error.o         open_read.c      stralloc_pend.o  warn-shsgr
error_str.c     openreadclose.c  str_chr.c        x86cpuid.c
error_str.o     openreadclose.h  str_chr.o
fd_copy.c       openreadclose.o  str_diff.c
fd_copy.o       open_read.o      str_diff.o

sunny | 15 Dec 00:02 2003
Picon

How to add

Hello,

kindly tell me how to add my self in to log <at> list.cr.yp.to

Thanx 
sunny

George Georgalis | 7 Dec 00:01 2003

klog under linux 2.6.0-test11


I've not been able to get socklog-1.0.0 (socklog-klog)
to work correctly on Athlon 2.6.0-test11 kernels:

 <at> 400000003fd17d7c2223ccac socklog: fatal: read(): permission denied
 <at> 400000003fd17d7d24122374 socklog: fatal: read(): permission denied
 <at> 400000003fd17d7e25ec59e4 socklog: fatal: read(): permission denied
 <at> 400000003fd17d7f27d05454 socklog: fatal: read(): permission denied
 <at> 400000003fd17d8029a8833c socklog: fatal: read(): permission denied
 <at> 400000003fd17d812b9e6b84 socklog: fatal: read(): permission denied

I modified my /etc/socklog/klog/run file as such:

#!/bin/sh
exec </proc/kmsg
exec 2>&1
exec softlimit -m 2000000 setuidgid log strace socklog ucspi

and found:

 <at> 400000003fd17dcc30534cbc open("/lib/libc.so.6", O_RDONLY)        = 3
 <at> 400000003fd17dcc3054db2c read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\30\222"..., 1024) = 1024
 <at> 400000003fd17dcc3058368c fstat64(3, {st_mode=S_IFREG|0755, st_size=1153784, ...}) = 0
 <at> 400000003fd17dcc305a519c old_mmap(NULL, 1166560, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4001e000
 <at> 400000003fd17dcc305ba18c mprotect(0x40131000, 40160, PROT_NONE)  = 0
 <at> 400000003fd17dcc305d011c old_mmap(0x40131000, 24576, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 3, 0x113000) = 0x40131000
 <at> 400000003fd17dcc305f992c old_mmap(0x40137000, 15584, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40137000
 <at> 400000003fd17dcc3060ed04 close(3)                                = 0
 <at> 400000003fd17dcc306e4ae4 munmap(0x40014000, 37165)               = 0
 <at> 400000003fd17dcc30717f34 read(0, 0x804b740, 8192)                = -1 EPERM (Operation not permitted)
 <at> 400000003fd17dcc307382d4 write(2, "socklog: fatal: read(): permissi"..., 42socklog: fatal:
read(): permission denied
 <at> 400000003fd17dcc30743e54 ) = 42
 <at> 400000003fd17dcc3076caac _exit(111)                              = ?
 <at> 400000003fd17dcd320fe90c execve("/command/socklog", ["socklog", "ucspi"], [/* 3 vars */]) = 0
 <at> 400000003fd17dcd3492cb2c uname({sys="Linux", node="trot.local", ...}) = 0
 <at> 400000003fd17dcd349714d4 brk(0)                                  = 0x8050000
 <at> 400000003fd17dcd34994b3c open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
 <at> 400000003fd17dcd349b470c open("/etc/ld.so.cache", O_RDONLY)      = 3
 <at> 400000003fd17dcd349c8b44 fstat64(3, {st_mode=S_IFREG|0644, st_size=37165, ...}) = 0
 <at> 400000003fd17dcd349ef85c old_mmap(NULL, 37165, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40014000
 <at> 400000003fd17dcd34a082e4 close(3)                                = 0

I don't know what it is but "read(0, 0x804b740, 8192)" seems the cause.

This is an older install and I'm not sure what gcc I used to build
socklog, but the kernel was made with gcc 3.3.2 if that makes any
difference. What's going on here?

I got an offline response from the misc <at> smarden.org list that said
removing "setuidgid log" from my run script would make the error go
away, is that the _only_ fix?

-r--------    1 root     root            0 Dec  6 17:52 /proc/kmsg

I tried changing the ownership:

-r--------    1 log      root            0 Dec  6 17:53 /proc/kmsg

Even opening it up completely:

-r--r--r--    1 log      root            0 Dec  6 17:57 /proc/kmsg

...same problem. Guess I could run socklog as root, but that doesn't
sound right either.

// George

--

-- 
GEORGE GEORGALIS, System Admin/Architect    cell: 646-331-2027    <IXOYE><
Security Services, Web, Mail,            mailto:george <at> galis.org 
Multimedia, DB, DNS and Metrics.       http://www.galis.org/george 

Dale Gallagher | 26 Nov 11:16 2003
Picon

thttpd-2.2.4 + daemontools-0.76

Hi there

Just giving thttpd a go, but am experiencing difficulties
in running it under daemontools, my preferred method of
process control.  I've managed to run it, testing on port
8500, without logging via multilog, like so:

/service/thttpd/run:

#!/bin/sh
exec setuidgid thttpd /usr/local/sbin/thttpd \
    -D -p 8500 -d /home/httpd/iphost/html -u thttpd \
    -l /var/log/thttpd/thttpd.log

However, as per a post by Yusuf Goolamabbas to the thttpd
list on 2000-09-26, I tried the following to log via
multilog and it dies repeatedly, resulting in a defunct
thttpd process.

/service/thttpd/run:

#!/bin/sh
exec setuidgid thttpd /usr/local/sbin/thttpd \
    -D -p 8500 -d /home/httpd/iphost/html -u thttpd \
    -l /dev/stdout

/service/thttpd/log/run:

#!/bin/sh
exec setuidgid thttpd multilog t /var/log/thttpd

Setup info:

Linux 2.4.22
GCC 3.2.2
thttpd-2.2.4
daemontools-0.76

Any pointers/solutions would be appreciated.

Thanks
Dale

 
==
Download ringtones, logos and picture messages at Ananzi Mobile Fun.
http://www.ananzi.co.za/cgi-bin/goto.pl?mobile

Matthew Patterson | 17 Nov 17:46 2003

list archive and question

I apologize for posting this to the list for the logging portion of
daemontools, but I cannot find a list for the svc/svcscan/supervise portion.

I also was unable to find a list archive for this list, so if there is one,
please let me know how I can access it.

I have just built daemontools on two different systems, RedHat 8 and Fedora
Core 1. On the 8 system, everything built fine. At the end of
./package/install on the Fedora system, I got the errors:
./load envdir unix.a byte.a
envdir.o(.text+0xca): In function `main':
: undefined reference to `errno'
envdir.o(.text+0x1f9): In function `main':
: undefined reference to `errno'
unix.a(openreadclose.o)(.text+0x3b): In function `openreadclose':
: undefined reference to `errno'
unix.a(pathexec_run.o)(.text+0x10e): In function `pathexec_run':
: undefined reference to `errno'
unix.a(pathexec_run.o)(.text+0x152): In function `pathexec_run':
: undefined reference to `errno'
unix.a(readclose.o)(.text+0x63): more undefined references to `errno' follow
collect2: ld returned 1 exit status
make: *** [envdir] Error 1
Copying commands into ./command...
cp: cannot stat `compile/svscan': No such file or directory

I also tried copying the binaries that I built on the RedHat 8 system to the
Fedora system. When I try to run svc I get the error:
Incorrectly built binary which accesses errno or h_errno directly. Needs to
be fixed.
svc: warning: unable to control (/directory/name/from/command/line): file
does not exist

On both systems, my
LD_LIBRARY_PATH=:/home/ace/ACE_wrappers/ace:/usr/tibco/tibrv/lib:/home/ace/A
CE_wrappers/ace:/usr/tibco/tibrv/lib

I guess that my questions are:
1. Has anyone built daemontools on Fedora Core 1, or any of the Betas?
2. Are there any thoughts as to how I can fix this error and either get
daemontools to build on the Fedora system, or to use the RedHat 8-built
binaries on the Fedora system?

Thanks for any help that you can provide.

Matthew H Patterson
Network Administrator
Sun Trading, LLC
440 S LaSalle
Suite 1534
Chicago, IL 60605
+1 312.362.4197
matthew.patterson <at> suntradingllc.com

Jurjen Oskam | 12 Nov 11:18 2003

daemontools-0.76, AIX 5.2: problem restarting service

Hi everybody,

On an AIX 5.2 machine, I use daemontools-0.76. Today, because of
an out-of-memory situation, processes were killed by the VMM.
I know that one supervise process was killed, the one supervising
the service /service/enable-printers.

Now, the state of the services is:

/service/clear-errors: down 4462 seconds, normally up, want up
/service/dsmcad: up (pid 766010) 783525 seconds
/service/enable-printers: up (pid 360594) 1081 seconds
/service/nmbd: up (pid 774230) 776558 seconds
/service/qmail-send: up (pid 704574) 775375 seconds
/service/qmail-smtpd: down 1198531 seconds
/service/smbd: up (pid 823454) 776558 seconds
/service/umclient: up (pid 184372) 1198531 seconds
/service/qmail-send/log: up (pid 167974) 1198531 seconds
/service/qmail-smtpd/log: up (pid 278668) 1198531 seconds
/service/umclient/log: up (pid 274568) 1198531 seconds

The output of "ps -ef | grep super[v]ise":

    root 188608 266410   0   Oct 29      -  0:09 supervise clear-errors
    root 204830 266410   0   Oct 29      -  0:00 supervise log
    root 221268 266410   0   Oct 29      -  0:00 supervise log
    root 241896 266410   0   Oct 29      -  0:00 supervise umclient
    root 245928 266410   0   Oct 29      -  0:00 supervise log
    root 250042 266410   0   Oct 29      -  0:00 supervise qmail-smtpd
    root 258228 266410   0   Oct 29      -  0:00 supervise dsmcad
    root 290982 266410   0   Oct 29      -  0:00 supervise qmail-send
    root 323614      1   0   Oct 29      -  0:00 /command/readproctitle
service errors: ...e: warning: unable to fork for clear-errors, sleeping 60 seconds: out of
memory?/usr/local/bin/enable-printers[56]: 585852
Killed?/usr/local/bin/enable-printers[44]: 0403-031 The fork function failed. There is not enough
memory available.?supervise: warning: unable to fork for enable-printers, sleeping 60 seconds: out of
memory?svscan: warning: unable to fork for enable-printers: out of memory?
    root 528562 266410   0 10:38:39      -  0:00 supervise enable-printers
    root 602298 266410   0   Nov 03      -  0:00 supervise smbd
    root 622728 266410   0   Nov 03      -  0:00 supervise nmbd

The output of "ps -ef | grep command.sv[s]can":

    root 266410 323614   0   Oct 29      -  1:39 /command/svscan /service

The output of "cat /service/clear-errors/run":

#!/bin/ksh
print -n '..........' >&2
sleep 300

I did not expect /service/clear-errors to be in "want up" state. I expected
it to be "up". Prior to the memory exhaustion, this service has worked
fine.

No process on the system has 188608 as PPID:

# ps -ef | grep 1[8]8608
    root 188608 266410   0   Oct 29      -  0:09 supervise clear-errors

While, for example, process 241896 does appear as a PPID:

# ps -ef | grep 2418[9]6
    root 184372 241896   0   Oct 29      -  7:57 /usr/upsman/umclient/umc -v
    root 241896 266410   0   Oct 29      -  0:00 supervise umclient

A truss of the complaining supervise process only showed one line, and I
interrupted it after 5 minutes:

# truss -p 188608
_poll(0x00000000, 0, 0)         (sleeping...)
Pstatus: process is not stopped

What can I do to further diagnose this? I didn't do "svc -t
/service/clear-errors" or "svc -dx /service/clear-errors" yet.

--

-- 
Jurjen Oskam

PGP Key available at http://www.stupendous.org/

Bernhard Graf | 31 Oct 15:17 2003
Picon

daemons logging to a file

Hi,

I want to run a program under svscan with logs piped to multilog.
Unfortunately this program can only log to either syslog or to a file.

My first idea was a fifo, that is read by a program that prints to 
stdout (cat) and let the program log to this fifo ... something like 

test -e "$fifo" && rm -f "$fifo"
mknod -m666 $fifo p
cat $fifo &
exec setuidgid $uid $program

This looks a bit kludgy. Has anyone a better idea (besides patching the 
program or using another one)?
--

-- 
Bernhard Graf <log031031 <at> augensalat.de>

Chris Berry | 22 Oct 00:02 2003
Picon

tmda-ofmipd under daemontools

I'm trying to set up tmda-ofmipd under daemontools.  This is my first time 
setting something up this way (not counting qmail where I just followed 
directions).  Here is what I did:

mkdir /var/log/qmail/tmda-ofmipd
mkdir -p /var/qmail/supervise/tmda-ofmipd/log
chmod +t /var/qmail/supervise/tmda-ofmipd

tmda-ofmipd run file looks like this:
#!/bin/sh
exec /usr/local/src/tmda-0.81/bin/tmda-ofmipd -f -S 
/usr/local/src/vmailmgr-vdir.sh -u root

tmda-ofmipd log run file looks like this:
#!/bin/sh
exec /usr/local/bin/multilog t /var/log/qmail/tmda-ofmipd

then I created a symlink to start the service

ln -s /var/qmail/supervise/tmda-ofmipd tmda-ofmipd

The service won't stay up for more than a second though.  I went back and 
checked to see if my run files had bad line endings or syntax but I didn't 
see anything obvious.  Can someone point me in the right direction?

Chris Berry
compjma <at> hotmail.com
Systems Administrator
JM Associates

"We are successful when our bosses wonder what it is we do all day."  -- Tim 
Mullen

_________________________________________________________________
Enjoy MSN 8 patented spam control and more with MSN 8 Dial-up Internet 
Service.  Try it FREE for one month!   http://join.msn.com/?page=dept/dialup


Gmane