Re: svscanboot and environment variables

Laurent Bercot <[email protected]>
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
> Since I'd like to keep all environment variables that are defined at the
> time svscanboot is started, I'm thinking about using svscan directly.

 svscanboot is a shell script, so you can edit it and remove the
"env - PATH=$PATH" part before "svscan". This will keep the environment,
apart from the PATH that is set at the top of the script.

 Alternatively, you can install execline
<URL: http://www.skarnet.org/software/execline/ > and use the script
provided in attachment, removing the /command/emptyenv and maybe
/command/export lines at the top of the script. This is an exact rewrite
of the svscanboot script; the benefit is that you don't keep a /bin/sh
running along with svscan and readproctitle.

 Better yet is to forget readproctitle and use a catch-all logging
service by having svscan writing to a fifo and some (supervised) multilog
reading from that fifo. The setup has been discussed on the supervision
list ([email protected]).


> If I want to keep the readproctitle functionality, is it enough to include
> the quoted command in /etc/inittab (providing pipes work there)?

 I don't know AIX, but I'd advise to stick to DJB's way - calling a script
from /etc/inittab - modifying the script if necessary. You never know:
you might be bitten by some hidden inittab non-portability, or by the
fearful process group trap.
 (Or you might forget init and run svscan as process 1, as Paul and I do,
but I suppose that's not an option.)

-- 
 Ska
svscanboot.exl (text/plain, 836 B)
#!/command/execlineb -P

/command/emptyenv
/command/export PATH /command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin

/command/redirfd -r 0 /dev/null
redirfd -w 1 /dev/null
redirfd -w 2 /dev/null

foreground
{
  multisubstitute
  {
    elglob DIR /service/*
    elglob -0 DIRLOG /service/*/log
  }
  svc -dx $DIR $DIRLOG
}

pipeline -w
{
  readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
}

fdmove -c 2 1
svscan /service
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.