I have the following entry in /etc/rc in the function localrc():
# Start the News Server
if [ -x /usr/local/etc/rc.news ]; then
echo "Starting Internet News Server..."
su news -c /usr/local/etc/rc.news >/dev/console
fi
On reboot the line "Starting Internet News Server..." is printed out
yet the server does not start. If I enter the line as root is does
start.
--
Mario Piazzese - Senior Systems Engineer, ULTRADATA Australia Pty. Ltd.
1919 Malvern Road, East Malvern, Victoria, Australia 3145.
P.O. Box 42, Carnegie, Victoria, Australia, 3163.
Voice: +61-3-9885-2211, Fax: +61-3-9885-2222
Nohup the su:
nohup su news -c /usr/local/etc/rc.news >/dev/console
Parts of the server take a while to start, and when /etc/rc terminates,
it essentially kills all child process groups.
--
Chris Lewis: _Una confibula non sat est_
: I have the following entry in /etc/rc in the function localrc():
: # Start the News Server
: if [ -x /usr/local/etc/rc.news ]; then
: echo "Starting Internet News Server..."
: su news -c /usr/local/etc/rc.news >/dev/console
: fi
: On reboot the line "Starting Internet News Server..." is printed out
: yet the server does not start. If I enter the line as root is does
: start.
I had the same problem on various versions of HP-UX.
First thing, you need to be root to open the nntp port. Inndstart
does this, so I made it setuid root. This is mentioned in Install.ms.
Another glitch is that the rc.news script does "su news". If you are
already news, it asks for a password. This does not work well
unattended. So I set the variable NEWSEXEC to "su news" or "/bin/sh"
if I'm root or news, respectively.
The method that rc.news uses to start innwatch doesn't (or didn't)
work on hpux for some reason. I've seen it mentioned elsewhere. This
has also been changed.
I also put in a hack to allow rc.news to be called from innwatch,
without starting another innwatch or clobbering its lock file.
This is probably more than you want, but here's the diffs from the
original in inn1.4-sec.
Dan Smisko
11c11
< DOINNWATCH=false
---
> DOINNWATCH=${1:-true}
16c16
< FLAGS="-i0"
---
> FLAGS="-i0 -x"
17a18,27
> : ${SHELL:=`sed -n '/^news/s/.*://p' /etc/passwd`}
> if [ `whoami` = root ] ; then
> NEWSEXEC="su ${NEWSUSER}"
> elif [ `whoami` = ${NEWSUSER} ] ; then
> NEWSEXEC=$SHELL
> else
> echo Can\'t execute as `whoami`
> exit 1
> fi
>
53c63
< # && mv history.n.pag history.pag" | su ${NEWSUSER}
---
> # && mv history.n.pag history.pag" | ${NEWSEXEC}
58c68,71
< ( cd ${LOCKS} && rm -f LOCK* )
---
> ( cd ${LOCKS} &&
> for i in LOCK* ; do
> ${DOINNWATCH} || [ -z "$1" ] || [ "$i" != LOCK.innwatch ] && rm -f "$i"
> done )
66,69c79,80
< # Gee, looks like lisp, doesn't it?
< ${DOINNWATCH} && {
< echo "( ( sleep 60 ; ${INNWATCH} ) & )" | su ${NEWSUSER}
< }
---
> ${DOINNWATCH} &&
> $SHELL -c "nohup $NEWSEXEC -c \"sleep 60 ; ${INNWATCH}\" <&- >&- 2>&- &"
78c89
< echo "${NEWSBIN}/expirerm ${RMFILE}" | su ${NEWSUSER} &
---
> $SHELL -c "nohup $NEWSEXEC -c \"${NEWSBIN}/expirerm ${RMFILE}\" <&- >&- 2>&- &"
We had the same problem too. Solution is to make absolutely sure you have
HAVE_SETSID set to "DO" in your config.data file. That fixes the problem.
Scotty
=================================================================
Steve Howie Email: sho...@uoguelph.ca
NetNews and Listserv Admin. Phone: (519) 824-4120 x2556
Computing and Communications Svcs. Fax: (519) 763-6143
University of Guelph
If it's not Scottish its CRRRRRAAAAAAAAAAAAAAPPPPP
=================================================================