Sa-learn  run as clamav or root

I have been running sa-learn as root. I now believe this is wrong and should be running as clamav
however I get problems running as clamav. I believe I have the correct permissions..
my junk and NotJunk folders are as follows
drwx------ 285 cyrusima mail 9690 May 14 12:50 junkmail
drwx------ 6 cyrusima mail 204 May 14 11:08 notjunkmail
I get the following errors:
sudo -u clamav sa-learn --spam /var/spool/imap/user/junkmail
bayes expireoldtokens: lock: 5428 cannot create tmp lockfile /private/var/root/.spamassassin/bayes.lock.fileserver.onestep.co.uk.5428 for /private/var/root/.spamassassin/bayes.lock: Permission denied
Unable to open /var/spool/imap/user/junkmail: Permission denied
Learned from 0 message(s) (0 message(s) examined).
or
fileserver:/var/spool/imap/user root# su - clamav
[fileserver:~] clamav% sa-learn --spam /var/spool/imap/user/junkmail
Unable to open /var/spool/imap/user/junkmail: Permission denied
Learned from 0 message(s) (0 message(s) examined).
Also how can I tell that the sa-learn script has run automatically at night?
when I run
su - clamav -c "sa-learn --dump magic"
I get
0.000 0 3 0 non-token data: bayes db version
0.000 0 205 0 non-token data: nspam
0.000 0 13929 0 non-token data: nham
0.000 0 156732 0 non-token data: ntokens
0.000 0 1178593410 0 non-token data: oldest atime
0.000 0 1179144505 0 non-token data: newest atime
0.000 0 1179144088 0 non-token data: last journal sync atime
0.000 0 1179140819 0 non-token data: last expiry atime
0.000 0 345600 0 non-token data: last expire atime delta
0.000 0 253032 0 non-token data: last expire reduction count
Xserve Mac OS X (10.4.8) Intel and PPC systems
TIA

You are much better off getting spamtrainer and let it do this for you.
However, for general education purposes read on
I have been running sa-learn as root. I now believe
this is wrong and should be running as clamav
You must run it as user clamav
however I get problems running as clamav. I believe I
have the correct permissions..
my junk and NotJunk folders are as follows
drwx------ 285 cyrusima mail 9690 May 14
12:50 junkmail
drwx------ 6 cyrusima mail 204 May 14
11:08 notjunkmail
I get the following errors:
sudo -u clamav sa-learn --spam
/var/spool/imap/user/junkmail
bayes expireoldtokens: lock: 5428 cannot create tmp
lockfile
/private/var/root/.spamassassin/bayes.lock.fileserver.
onestep.co.uk.5428 for
/private/var/root/.spamassassin/bayes.lock:
Permission denied
Unable to open /var/spool/imap/user/junkmail:
Permission denied
Learned from 0 message(s) (0 message(s) examined).
or
fileserver:/var/spool/imap/user root# su - clamav
[fileserver:~] clamav% sa-learn --spam
/var/spool/imap/user/junkmail
Unable to open /var/spool/imap/user/junkmail:
Permission denied
Learned from 0 message(s) (0 message(s) examined).
This is because the user's mailboxes are owned by root.
To work around this do the follwing as root:
cat /var/spool/imap/user/junkmail/messagefilenumber. | su - clamav -c "sa-learn --spam
Also how can I tell that the sa-learn script has run
automatically at night?
when I run
su - clamav -c "sa-learn --dump magic"
I get
0.000 0 3 0 non-token
data: bayes db version
0.000 0 205 0 non-token
data: nspam
0.000 0 13929 0 non-token
data: nham
0.000 0 156732 0 non-token
data: ntokens
0.000 0 1178593410 0 non-token
data: oldest atime
0.000 0 1179144505 0 non-token
data: newest atime
0.000 0 1179144088 0 non-token
data: last journal sync atime
0.000 0 1179140819 0 non-token
data: last expiry atime
0.000 0 345600 0 non-token
data: last expire atime delta
0.000 0 253032 0 non-token
This tells you what the bayes db has beend fed with so far. Whether this happend automatically or manually is a different issue.
sa-learn will not run automatically unless you told it to by means of a startup item, cron job, .... If you did you should know which logs to check.

Similar Messages

  • How do I run an app as root at Login?

    Hi,
    I need to run an application as root at login (not startup). The terminal command to do this is:
    sudo -b /Applications/MarcoPolo.app/Contents/MacOS/MarcoPolo
    Is there a way to run "/Applications/MarcoPolo.app/Contents/MacOS/MarcoPolo" as root when a user logs in?

    Perhaps there is a more graceful way to do this using launch daemons (you should ask on the [Unix forum|http://discussions.apple.com/forum.jspa?forumID=735] but the following will work.
    paste the following into Script Editor and save it as an application. Add that application to your login items.
    do shell script "/Applications/MarcoPolo.app/Contents/MacOS/MarcoPolo" user name "your-admin-username" password "your-admin-password" with administrator privileges
    You'll have to enter your admin username and password in the above in open text. This is a clear drawback of course.
    I don't know how to incorporate -b option in this.

  • How do I run an application as root?

    I want to run this application as root because I want to allow it to listen on a port lower than 1024. It is a regular application I am used to running by double clicking it in the Finder. In the Terminal, I have su'ed to root, and I try to run it by typing ./Warcraft\ III, however I receive the error:
    ./Warcraft III: cannot execute binary file
    The file has the correct permissions (755), and it is not a directory (and does not have a .app extension). I am used to double clicking this file in Finder to start it.
    Thank you

    Hi Boyd,
    > is there a way to run an application starting from
    Finder as superuser
       I may not be understanding what you mean as root is the superuser but there are a variety of ways to make script commands "double-clickable". You can put the following in an AppleScript:
    do shell script "/System/Library/Frameworks/Carbon.framework/Versions/Current/Support/LaunchCFM App /<Absolute>/<Path>/<to>/Warcraft\ III" with administrator privileges
    Save the AppleScript as an application and you will be able to double-click on it.
       You can save the shell script with a filename suffix of ".command" and it will be double-clickable.
       Finally, use Sveinbjorn Thordarson's Platypus to turn the script into a double-clickable application.
    Gary
    ~~~~
       Don't take life seriously, you'll never get out alive.

  • Sa-learn running?

    The Mail Service Guide
    http://images.apple.com/server/macosx/docs/Mail_Service_Admin_v10.6.pdf
    says that sa-learn runs every night.
    However, I see no sign of this in the amavis logs, nor in daily.out
    Under what user's crontab does it run
    Where is it logged?
    Also, is there a scheduled run of sa-update?

    The Mail Service Guide
    http://images.apple.com/server/macosx/docs/Mail_Service_Admin_v10.6.pdf
    says that sa-learn runs every night.
    However, I see no sign of this in the amavis logs, nor in daily.out
    Under what user's crontab does it run
    Where is it logged?
    Also, is there a scheduled run of sa-update?

  • [SOLVED]Unable to run Graphical applications as root/sudo

    Ok so ive been working on getting my very first Arch install up and running and I need to get the catalyst drivers running for my HD6850 because I plan on doing some wine gaming.
    So I followed the instructions here on the wiki for ATI catalyst and I now have the drivers up and running, tried glxgears and everything is fine. The issue I am having Is that when I go under the settings menu in KDE I have the "AMD Catalyst control center" there, however I do not have the (Administrative) option that I get with all other distros. I need to run the CCC as root to beable to configure my multiple monitors.
    In a terminal when i enter;
    sudo amdcccle
    It returns with the following;
    No protocol specified
    amdcccle: cannot connect to X server :0
    So after a little digging I found this thread on the ubuntu forums that was quite helpful;
    http://ubuntuforums.org/showthread.php?t=307984
    So I ran
    DISPLAY=:0.0 xhost +
    then tried again to run
    sudo amdcccle
    and like magic it worked and I was able to configure my displays.
    However this is not a permanent fix. Can anyone see a more permanent solution to this issue? This affects more than just the Catalyst Control Center; It stops me from running any graphical application as root or with sudo. Also can anyone explain what is causing the issue?
    I have searched to the best of my ability and as you can see I have for the most part fixed the issue, however I cannot seem to find a permanent fix, nor do I really know what caused the issue to begin with.
    Last edited by relik (2011-07-03 20:21:52)

    SOLVED
    I took your advice about installking something like gksudo, and rememberd that on my kubuntu install I had something called kdesu. So Since im running KDE and not Gnome, I did some searching and found out how to install kdesudo using the AUR.
    Just followed the install guide here for Yaourt ---> https://wiki.archlinux.org/index.php/Yaourt
    Once I did that i just ran
    yaourt kdesudo
    selcted #1 and installed.
    Now when I need to run a GUI based app as root I type in
    kdesu <NAME OF APP>
    So to solve my original issue I just run
    kdesu amdcccle
    instead of
    sudo amdcccle
    This seems to work for any app that needs to be ran a root with a GUI.
    Also if your like me and you want to beable to just open CCC from your kickoff menu then do the following;
    1. Right click kickoff > edit applications
    2. Go to "Settings" > ATI Catalyst Control Center
    3. In the Command Field add "kdesu" without quotes to the begining of the line so it looks like this
    kdesu amdcccle
    4. Save
    Last edited by relik (2011-07-03 20:22:55)

  • Run shell script as root on boot

    Hi!
    I have the need to run a shell script on boot up as root.
    It will not run as any other user because the software that the shell script runs requires root permissions, and I don't use my computer as root. I can't run it at login and use sudo because it would ask for a password and hang.
    How can I have the shell script auto-run at boot (or login) as root?
    Thanks
    Ross

    Hi,
    first of all you can store your shell script anywhere on your system, I prefere the location /usr/local/scripts (this doesn't exist by default).
    Second you have to create a LaunchDeamon script in /Library/LaunchDeamons which execute your shell script at boot as root.
    An example:
    -------------------------snip------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
    1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>YOURIDENTIFIERNAME</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/scripts/YOUR_SCRIPT.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>ROOT</string>
    <key>GroupName</key>
    <string>WHEEL</string>
    </dict>
    </plist>
    -------------------------snap------------------------
    http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemS tartup/Articles/LaunchOnDemandDaemons.html
    To run a script as root during a user login you can configure a LoginHook. To create a LoginHook login as the relating user and type the following commad:
    sudo defaults write com.apple.loginwindow LoginHook /Path/To/Your/Script
    http://support.apple.com/kb/HT2420
    Hope that helps
    Bye Tom

  • Run login script as root

    Is there a good way that one can run a login script as root these days?  In doing some research, I learned about login hooks, which assist with that.  Though with further research, I learned that newer OSes don't support that (or, rather, are depricated).  Is there maybe some sort of app you can run which will give you root access at a standard user login?  I am needing to work with the current user's home directories- as in, rename stuff that a standard user can't seem to do.
    Though on a related note, I noticed that OS X creates extended attributes in the user's folders which says that "everyone" can't delete them.  Renaming them wouldn't count as the delete attribute since I'd use the mv command on it, would it?  I haven't tried yet but I'm assuming that isn't my answer, anyway.
    Thanks!

    is this somthing that needs to be done each time you or the other user logs in or does it just need to be done once?
    If it is ongoing then yes you might have to do this with some sort of login script. But if it is a one time thing (make the alias once and that's it), then you can use the sudo command.
    Roughly you would log in as yourself, open the terminal app and then  use the sudo command to change the other users folder.
    If it is a one time thing post back and explain EXACTLY what it is you need to do and we'll try to come up with the steps to do it.
    If it is an ongoing thing then I'm not sure what the best path is to take.
    regards

  • Need to run fmsedge process without root access

    1937396
    On Linux, the fmsedge process needed to run without root access.

    I see that in the release notes
    new in this release:
    1937396
    On Linux, the fmsedge process needed to run without root access.
    However I have not found any documentaion on how to do this?
    I would love to run the fmsedge process run as non-root so tht root does not own the 1935 listening port.
    fmsedge   26837  root   19u  IPv4  4007676       TCP localhost:19350 (LISTEN)
    fmsedge   26837  root   24u  IPv4  4007679       TCP *:1935 (LISTEN)
    fmsedge   26837  root   35u  IPv4  4007717       TCP localhost:19350->localhost:59625 (ESTABLISHED)
    fmsedge   26837  root   57u  IPv4 26532589       TCP localhost:19350->localhost:58913 (ESTABLISHED)
    This appear to not be the default setup.
    Thanks in advance if anyone has tackled this!

  • Cannot run privoxy as non-root user

    Hi all,
    I am having some problems running privoxy as a non-root user.  I am not quite sure where to look as I simply get a return / exit status of 1.  I didn't see what that maps to on privoxy's site.  As an aside, privoxy works fine in my regular install, but in my USB thumbdrive install with AUFS overlay, that is where I am having issues.  It might be a filesystem permission issue, but I don't see anything with journalctl -xn or dmesg or privoxy's logs that tells me anything.
    Does anyone have any ideas what else to look for?
    Thanks,
    Walter

    Hi,
    Thanks for your reply - AUFS is a filesystem (I am running ArchLinux off of an SD card where the rootfs is squashfs with an AUFS overlay).  I've had issues with it in the past which turned out to really be permission issues.  I had an issue before where CUPS was unable to print because of the permissions, but it fixed itself after an upgrade.
    I don't have any error messages to review to make solving the problem any easier.  The only thing I verified was I took the systemd unit file and ran the same command as root and privoxy and it worked under root, but failed under privoxy.
    Walter

  • Creating a package such that its postinstall script runs as a non-root user

    The pkgmap(4) man page I have (says "Last change: 30 Apr 1999"; from SUNWman 42.6,REV=6.1) says of the owner and group fields in a pkgmap entry line:
    "This field is not used for linked files or non-installable files. It is used optionally with a package information file. If used, it indicates with what [owner/group] an installation script will be executed."
    The pkgmap file I get after running pkgmk on my prototype file contains a line like
        1 i postinstall 292 23672 1166416139for the postinstall script. The man page quote above suggests that if I want the script to be run with user and group fred/staff (say), I can hand-edit this line to instead be
        1 i postinstall fred staff 292 23672 1166416139However, pkgadd doesn't like this, complaining and failing thus:
        pkgadd: ERROR: bad entry read in pkgmap
            pathname=postinstall
            problem=extra tokens on input line
        pkgadd: ERROR: unable to process pkgmapFurthermore, there doesn't seem to be anything I can put in my prototype file to get these fields into the generated pkgmap. The corresponding owner/group fields are syntax errors for a package information file in a prototype file.
    All this, and the wording in the Application Packaging Developer's Guide, suggest that the pkgmap man page is wrong and there isn't a way to specify a non-root user and group as which you want your package's install scripts to run.
    On the other hand, the pkgadd confirmation "This package contains scripts which will be executed with super-user permission during the process of installing this package. / Do you want to continue with the installation of <PCBBserv> [y,n,?]" suggests that there might be some way to make a package such that it contains scripts which will be executed with ordinary user permissions, and thus not warrant a confirmation.
    Any suggestions?
    Thanks,
    John

    tpolich wrote:One more quick question, is rc.local run the backround or say if I asked for input would the system boot hang?
    Yes, rc.local itself would hang, but if you background the process inside rc.local using the '&' symbol at the end of the command, then that command will be backgrounded and rc.local can continue.

  • [SOLVED] Problem with running GUI apps as root

    Hi,
    I have a serious problem with running any kind of software having GUI as root, which is indispensable for editing system files. For example I want to edit /etc/pacman.conf file with KWrite, and here's what I get
    [zbyszek@barca ~]$ xhost +
    access control disabled, clients can connect from any host
    [root@barca zbyszek]# kwrite /etc/pacman.conf
    kwrite(11282): Session bus not found
    KCrash: Application 'kwrite' crashing...
    KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
    sock_file=/root/.kde4/socket-barca/kdeinit4__0
    Warning: connect() failed: : Nie ma takiego pliku ani katalogu
    KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
    drkonqi(11284): Session bus not found
    Can anyone help me with this? Can anyone tell me how to login as root?
    Thank you in advance.
    Last edited by Zibi1981 (2010-10-05 19:30:20)

    O.K., but how to run KWrite as root on my account??? That was my main question
    karol wrote:
    Try running 'xhost +' as root.
    https://bbs.archlinux.org/viewtopic.php?pid=817674
    Maybe vim is in edit mode when you press 'i' but it doesn't show '-- INSERT --' at the bottom of the screen.
    Here you are
    [root@barca zbyszek]# xhost +
    access control disabled, clients can connect from any host
    [root@barca zbyszek]# kwrite /etc/pacman.conf
    kwrite(12941): Session bus not found
    KCrash: Application 'kwrite' crashing...
    KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
    sock_file=/root/.kde4/socket-barca/kdeinit4__0
    Warning: connect() failed: : Nie ma takiego pliku ani katalogu
    KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
    drkonqi(12942): Session bus not found
    Last edited by Zibi1981 (2010-09-25 10:19:50)

  • Fan running.. "kernel root" and "WindowServer"

    pllleeeeaassee help!!!
    my fan wont stop running, and when i go to activitiy monitor, the processes "kernel root" and "WindowServer" are both taking up almost 60% of my CPU each... i've already tried resetting the PMU and PRAM... but when i dont think the PMU is successfully resetting, because i always have the correct time and date when i boot up again..?
    what do i do???

    my bad.. the file name is "kernel_task", not kernel root... "root" is the user though
    i've repaired the permissions... also, i'm not running my computer from the adaptor alone, no battery... so the fan has quit running (since no battery) yet these two operations are still sucking the CPU like mad outta me.... what are they working so hard on? and how can i get them to stop?

  • 3502p running as a mesh root AP

    Hi there,
    Does anybody know if the Cisco 3502p AP can run as a root mesh access point ?
    Sent from Cisco Technical Support iPhone App

    I would like to inform you that it can be used as Mesh root AP. But this AP is meant for High Density areas that require the cisco High-gain Stadium Antenna. For more detail you can go through the below link.
    http://www.cisco.com/en/US/prod/collateral/wireless/ps5679/ps5279/ps5285/product_data_sheet09186a008018495c.html

  • Cannot run xorg as non-root

    I have a fresh install of Arch Linux that is working great except I cannot run xorg as my normal login, only root.
    When I attempt to start X with either startxfce4 or startx, I get
    xf68openconsole: cannot open virtual console 1 (permission denied)
    XFCE is installed and works fine as root. I've done a lot of searching and I've found a lot of other people having this problem but none of their solutions have worked for me. I tried reinstalling xorg, checking my user permissions (I'm in the wheel group), and adding vt$XDG_VTNR to the end of my xserverrc file.
    I haven't used arch in a long time (before systemd) and I feel like a rank newbie! Nothing I have read suggests any need for permissions changes when installing X so I don't know why it's not working out of the box. I feel like it must be an obvious answer but I need someone to slap me in the face with it, obviously.
    Appreciate any help in advance-

    karol wrote:
    Post your ~/.xinitrc and the exact command you use e.g. 'startx' or 'startx -- :1 vt$XDG_VTNR -keeptty' etc. Make sure e.g. 'startx' is not aliased to something.
    Have you tried starting it from another tty? Do you run the stock linux console in the tty or e.g. tmux?
    Post the output of
    uname -a
    What's your hardware and graphics drivers?
    xinitrc here
    I am using startxfce4:
    [root@ninja-laptop /]# type startxfce4
    startxfce4 is /usr/bin/startxfce4
    I haven't made any changes to the console or tty so I'm assuming I'm running it in stock. I haven't tried starting from another tty.
    [root@ninja-laptop /]# uname -a
    Linux ninja-laptop 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015 x86_64 GNU/Linux
    Thanks-

  • How do you run applications as NON root without any x (server) ?

    Hi! I'm trying to run mpd as a user right after init. According to the wiki one should use .xinitrc, but since there's no X server for me to run it won't work for me.
    I've tried this command in bashrc "( sleep 15 && mpd ~/.mpd/mpd.conf )" and yes it works assuming I ssh into my server.
    Where do you put script/commands to launch an application as a NORMAL user after init?
    My Setup:
    archlinux on a server, so no graphical input.
    Thanks

    dyscoria wrote:
    I don't use mpd, but you could try putting in /etc/rc.local which executes straight after daemons:
    su $username -c "mpd ~/.mpd/mpd.conf"
    Yeah I've already tried that also tried  (sleep 50 && mpd ~/.mpd/mpd.conf) &. But none of the commands executes to my knowledge, because it's been over 5 minutes now and mpd still hasn't started. Both commands works just fine if I enter em manually in the terminal.
    jac wrote:
    You know mpd won't actually be running as root, right?
    man mpd.conf wrote: user <username>
    This  specifies  the  user that MPD will run as, if set.  MPD should never run as root,
    and you may use this option to make MPD change its user id after initialization.  Do
    not use this option if you start MPD as an unprivileged user.
    Edit: Sorry, can't get that to look normal any way I do it. Best to view it straight from the terimnal
    Hi! I understand what you mean, thanks.
    No,  I assumed it would run as root. But you see I can't launch mpd as a daemon in rc.d, it always fails for me. The easiest way for me is to "mpd my.config" in some ways.

Maybe you are looking for