Help → popfile unable to start as a deamon process

popfile unable to start as a deamon process

Hi,

I am new to popfile and relatively new to ubuntu. Previously I was using spamhilator on windows and have recently installed and configured popfile with thunderbird on windows and Ubuntu. My main reason for switching to popfile is that I wanted to use same array of tools for both windows and linux. Now my problem is related to the startup of popfile as a deamon process. I have searched previous forum posts also and elsewhere on web, but could not found the solution relkated to the issue.

The issue is that popfile is not able to start as a deamon process, but when I try running popfile from startup script in /usr/share it starts without any issue. I am running Ubuntu 11.04 and have installed popfile and dependencies yesterday only, so I think all needed packages must be present with latest updates.

Please help me out. ty.

Following are the commands I tried and respective outputs.

$sudo /etc/init.d/popfile start
Starting popfile: popfile

tried to access web URI on http://localhost:7070, was greeted by page not found. Then tried following and it worked.

$sudo /usr/share/popfile/start_popfile.sh
POPFile Engine loading

Loading...

{core: config mq logger history}
{classifier: wordmangle bayes}
{interface: xmlrpc html}
{proxy: smtp pop3 nntp}
{services: imap}

POPFile Engine v1.1.1 starting

Initializing...

{core: config history logger mq}
{classifier: bayes wordmangle}
{interface: html xmlrpc}
{proxy: nntp pop3 smtp}
{services: imap}

Starting...

A copy of POPFile appears to be running.

Attempting to signal the previous copy.
Waiting 10 seconds for a reply.

The other POPFile (6178) failed to signal back, starting new copy (6226)

{core: config history logger mq}
{classifier: bayes wordmangle}
{interface: html}
{proxy: pop3}
{services:}

POPFile Engine v1.1.1 running

Contents of /var/log/popfile/popfile1313712000.log

2011/8/19 16:29:52 6178: -----------------------
2011/8/19 16:29:52 6178: POPFile v1.1.1 starting
2011/8/19 16:29:52 6178: bayes: 811: Attempting to connect to dbi:SQLite:dbname=/var/lib/popfile/popfile.db (1)
2011/8/19 16:29:52 6178: bayes: 912: Using SQLite library version 3.7.4
2011/8/19 16:30:39 6226: -----------------------
2011/8/19 16:30:39 6226: POPFile v1.1.1 starting
2011/8/19 16:30:39 6226: bayes: 811: Attempting to connect to dbi:SQLite:dbname=/var/lib/popfile/popfile.db (1)
2011/8/19 16:30:39 6226: bayes: 912: Using SQLite library version 3.7.4
2011/8/19 16:30:39 6226: Warning: POPFile may require Perl module BerkeleyDB; it is needed only for "Upgrades from v0.20.x".
2011/8/19 16:30:39 6226: Warning: POPFile may require Perl module File::Glob::Windows; it is needed only for "Japanese Language Support (Windows only)".
2011/8/19 16:30:39 6226: Warning: POPFile may require Perl module IO::Socket::Socks; it is needed only for "Socks Proxy Support".
2011/8/19 16:30:39 6226: Warning: POPFile may require Perl module MeCab?; it is needed only for "Japanese Language Support".
2011/8/19 16:30:39 6226: Warning: POPFile may require Perl module Text::Kakasi; it is needed only for "Japanese Language Support".
2011/8/19 16:30:39 6226: POPFile successfully started
2011/8/19 16:31:56 6226: POPFile stopped
2011/8/19 16:31:56 6226: ---------------

  • Message #1539

    I am running Ubuntu 11.04 and have installed popfile and dependencies yesterday

    How did you install POPFile?

    When I used the Synaptic Package Manager to install POPFile 1.1.1 on Xubuntu 11.04 (32-bit) today I had no trouble. All I did was tick the box for "POPFile" and Synaptic installed a total of 19 packages (I think it was 19 but I did not make a note at the time).

    After Synaptic installed everything all I had to do was use my browser to access http://localhost:7070 in order to see the POPFile User Interface. I did not have to do anything to start POPFile because it was started automatically after it had been installed.

    • Message #1540


      How did you install POPFile?

      I installed using terminal

      sudo apt-get install popfile

      After Synaptic installed everything all I had to do was use my browser to access http://localhost:7070 in order to see the POPFile User Interface. I did not have to do anything to start POPFile because it was started automatically after it had been installed.

      First time after installation it started fine for me too, but today morning when I booted again it could not start and then I went through all the exercise as I mentioned in my post.

      I am using x64 version of Ubuntu, but IMHO it should not be a problem, as popfile runs fine when started using startup script. Only the issue is of automatic startup after boot.

  • Message #1541

    Hi,

    Please check out the owner of files in '/var/lib/popfile'.
    They should be owned by popfile:popfile.

    $sudo /usr/share/popfile/start_popfile.sh

    This will start POPFile as 'root'.

    $sudo /etc/init.d/popfile start

    This will start POPFile as user 'popfile'.

    And, you can get some more detailed log by changing 'logger_level' to 2. For more information, please see:

    http://getpopfile.org/docs/troubleshooting:preparelog

    Naoki

    • Message #1542

      Thanks Naoki for your help, but unfortunately it still didn't work :(

      I checked the permissions on /var/lib/popfile and they were as follows

      drwxr-x--- 3 popfile popfile 4096 2011-08-19 18:40 messages
      -rw-r----- 1 root root 2131 2011-08-19 17:58 popfile.cfg
      -rw-r----- 1 popfile popfile 90112 2011-08-19 18:40 popfile.db
      -rw-r----- 1 root root 90112 2011-08-19 17:58 popfile.db.backup
      -rw-r--r-- 1 popfile popfile 1304 2011-08-19 00:12 stopwords

      I also changed logger level to 2 in popfile.cfg

      logger_format default
      logger_level 2
      logger_logdir /var/log/popfile/

      But still when I tried to start it from init.d

      $ sudo /etc/init.d/popfile start
      Starting popfile: popfile.

      Also in log it was as before

      2011/8/19 22:59:20 1919: -----------------------
      2011/8/19 22:59:20 1919: POPFile v1.1.1 starting
      2011/8/19 22:59:20 1919: bayes: 811: Attempting to connect to dbi:SQLite:dbname=/var/lib/popfile/popfile.db (1)
      2011/8/19 22:59:20 1919: bayes: 912: Using SQLite library version 3.7.4

      Then as per your suggestion, I tried changing the permissions of all files/folders in /var/lib/popfile

      drwxr-x--- 3 popfile popfile 4096 2011-08-19 18:40 messages
      -rw-r----- 1 popfile popfile 2131 2011-08-19 22:56 popfile.cfg
      -rw-r----- 1 popfile popfile 90112 2011-08-19 18:40 popfile.db
      -rw-r----- 1 popfile popfile 90112 2011-08-19 17:58 popfile.db.backup
      -rw-r--r-- 1 popfile popfile 1304 2011-08-19 00:12 stopwords

      Well, this time around something did happen when I tried starting from init.d. Here is the log output

      2011/8/19 23:06:22 1974: -----------------------
      2011/8/19 23:06:22 1974: POPFile v1.1.1 starting
      2011/8/19 23:06:22 1974: bayes: 811: Attempting to connect to dbi:SQLite:dbname=/var/lib/popfile/popfile.db (1)
      2011/8/19 23:06:22 1974: bayes: 912: Using SQLite library version 3.7.4
      2011/8/19 23:06:22 1974: bayes: 512: Performing tweak 1 to 1
      2011/8/19 23:06:22 1974: bayes: 2190: get_session_key returning key vyenzUN1sp27pIMQ4d34 for user XXXXXX
      2011/8/19 23:06:22 1974: mq: 380: post RELSE (vyenzUN1sp27pIMQ4d34)
      2011/8/19 23:06:22 1974: mq: 387: queuing post RELSE (vyenzUN1sp27pIMQ4d34)
      2011/8/19 23:06:22 1974: mq: 389: RELSE queue length now 0
      2011/8/19 23:06:22 1974: html: 66: Trying to open listening socket on port 7070.
      2011/8/19 23:06:22 1974: mq: 380: post UIREG (configuration:pop3_configuration:pop3-configuration-panel.thtml:Proxy::POP3=HASH(0x1c83398))
      2011/8/19 23:06:22 1974: mq: 387: queuing post UIREG (configuration:pop3_configuration:pop3-configuration-panel.thtml:Proxy::POP3=HASH(0x1c83398))
      2011/8/19 23:06:22 1974: mq: 389: UIREG queue length now 0
      2011/8/19 23:06:22 1974: mq: 380: post UIREG (security:pop3_security:pop3-security-panel.thtml:Proxy::POP3=HASH(0x1c83398))
      2011/8/19 23:06:22 1974: mq: 387: queuing post UIREG (security:pop3_security:pop3-security-panel.thtml:Proxy::POP3=HASH(0x1c83398))
      2011/8/19 23:06:22 1974: mq: 389: UIREG queue length now 1
      2011/8/19 23:06:22 1974: mq: 380: post UIREG (chain:pop3_chain:pop3-chain-panel.thtml:Proxy::POP3=HASH(0x1c83398))
      2011/8/19 23:06:22 1974: mq: 387: queuing post UIREG (chain:pop3_chain:pop3-chain-panel.thtml:Proxy::POP3=HASH(0x1c83398))
      2011/8/19 23:06:22 1974: mq: 389: UIREG queue length now 2
      2011/8/19 23:06:22 1974: pop3: 132: Opening listening socket on port 110.

      But it was stuck at this point. I was able to access neither web interface nor pop mail.

      At least we reached a little farther then where I had started :)

      Please help me further to resolve the issue.

      • Message #1543

        When POPFile is started using sudo /etc/init.d/popfile start it should use port 7070 for the User Interface and port 7071 for POP3 commands from the email client.

        Your log file shows that after being started from the init.d script POPFile is using port 7070 for the User Interface (which is correct) but it is trying to use port 110 for POP3 (and this will not work because only root can use port 110):

        2011/8/19 23:06:22 1974: html: 66: Trying to open listening socket on port 7070.
        2011/8/19 23:06:22 1974: pop3: 132: Opening listening socket on port 110.

        It is possible that the configuration file has the wrong port specified in it. This is an easy thing to fix. The popfile.cfg file is a simple text file. If you edit this file and change the pop3_port setting to 7071 then you should be able to run POPFile using the init.d script. If the pop3_port setting is not defined in the file just add this line to the file:

        pop3_port 7071
        

        (If this line is missing from popfile.cfg then POPFile will try to use port 110)

        After you save the changes, remember to make sure popfile.cfg has the correct permissions (i.e. -rw-r----- 1 popfile popfile) then try the init.d script again.

        Brian

        • Message #1544

          Your log file shows that after being started from the init.d script POPFile is using port 7070 for the User Interface (which is correct) but it is trying to use port 110 for POP3 (and this will not work because only root can use port 110):

          Thanks a lot Brian, changing the port from 110 to 7071 fixed the issue.

          I had changed it to port 110 after installation as I was using the same port on Win7 installation. I didn't knew that port 110 can only be used by root login. I learned another new thing, thanks to you :D

          • Message #1545

            port 110 can only be used by root login

            Many (Linux) systems only allow root (or superuser) to access ports below 1024 so changing the POP3 port from 110 to 7071 allows POPFile to be run by a non-root account.

            Glad to hear that POPFile is now working on your Ubuntu system.

            Brian

          • Message #1547

            Glad to hear that.

            Now, I recommend you to restore the 'logger_level' to 0.

            Naoki

            • Message #1550

              Now, I recommend you to restore the 'logger_level' to 0.

              lol, ty, forgot to change that back :D