[Techtalk] script run on bootup

Almut Behrens almut-behrens at gmx.net
Tue May 9 03:49:48 EST 2006


On Mon, May 08, 2006 at 02:10:53AM -0700, drichter at fastmail.fm wrote:
> Hi everyone.
> 
> I wrote a script to start the subversion daemon when the machine boots.
> It works when I run it from a login shell as root, but when I put it in
> /etc/init.d and the machine boots, it fails at this point:
> 
>    su svn -c '/usr/bin/svnserve -d -r ~svn' && success || failure
> 
> It says it can't execute /bin/bash. What's the problem?
> 
> (The machine runs Fedora Core 4, if that matters.)

Hi,

sounds like you have SELinux enabled...
In that case you'd probably get messages like

  avc: denied { transition } for pid=... comm="su" name=bash ...

in the syslog (or in /var/log/audit/audit.log, if running auditd).

If so, try replacing "su" with "runuser".   If that doesn't help,
I'd resort to more classic approaches (e.g. strace) to narrow down on
why exactly the command is failing...

Cheers,
Almut

P.S. for a gentle introduction to SELinux see
http://www.lurking-grue.org/selinuxHOWTO.html
(not entirely up-to-date, but still useful to get an idea of how to
find your way around)


More information about the Techtalk mailing list