Re: rc.local question/problem

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

 



On 02Jul2011 20:40, Paul Allen Newell <pnewell@xxxxxxxxxx> wrote:
| I am trying to run clamav from rc.local so it happens whenever I power 
| on and/or reboot. Script fails as though it can't open anything. Running 
| the script as root works like a champ. Am I mistaken in thinking that I 
| can run any *.sh file in ~root in rc.local and it will be run as root 
| (meaning no permission problems).

That should be the case. (Of course, SELinux can break anything - if you
run out of ideas you could turn it off to see if the behaviour changes.)

| Line in /etc/rc.d/rc.local:
| /root/virus-scan.sh > /dev/null 2>&1

Throwing away the output will not help your diagnosis. Try this:

  /root/virus-scan.sh >/root/rc-local-virus.out 2>/root/rc-local-virus.err

and see what shows up.

| Summary of version in ~root/virus-scan.sh
| #!/bin/sh
| COMMON_DIRS="/home /tmp" # skipping all /bin /sbin et al for this test
| /usr/bin/clamscan -ri $COMMON_DIRS --log="/var/log/clamscan.log"
| 
| Contents of log show /home as "can't open" and certain files in /tmp as 
| "Permission denied"

Weird.

Try putting some stuff at the start of virus-scan.sh:

  set -x
  pwd
  id

You can then verify that it is running as root and where.
The -x will let you check the command line of clamscan is correct.

Thought: is clamscan setuid or something?

If you get nowhere there, try stracing the clamscan run:

  strace -e trace=file /usr/bin/clamscan ...args..here...  2>/root/strace.out

and you should get to see exactly what clamscan is doing, filewise.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

We are all agreed that your theory is crazy. The question that divides us is
whether it is crazy enough to have a chance of being correct.
- Niels Bohr (to Wolfgang Pauli), 1958
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux