[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: issue with volatile clamav and/or freshclam

On Sat, Jun 21, 2008 at 03:50:36PM +0300, Jari Jokinen wrote:
> I fixed the issue by changing this line in the init script:
>   su "$User" -p -s /bin/sh -c ". /lib/lsb/init-functions && \
>   start_daemon -p $THEPIDFILE $DAEMON"
> to:
>   . /lib/lsb/init-functions && start_daemon -p "$THEPIDFILE" "$DAEMON"

The su was giving me grief as well, though for a different reason.

It seems that su fails if there is no controlling terminal.   This
was making it impossible to successfully run, e.g.,
'invoke-rc.d clamav-daemon restart' from a cron script.

(To fix this I changed the 'su "$User" ...' line to just

   start_daemon -p "$THEPIDFILE" "$DAEMON"

Init-functions is sourced near the top of the init script, so doesn't
need to be sourced again.)

> So, my question is: why the su command is there and is it essential?

I am interested in the answer to this question as well.   It appears that
clamd changes its uid all by itself, even when run (as root) without su.
Is there some reason that the su is necessary?

Jeff Dairiki

Reply to: