Email Issue

Discussion in 'General' started by abintipl, Jul 20, 2012.

  1. abintipl

    abintipl New Member

    Hello,

    My set up is Ispconfig3 with Debian Squeeze

    For last few days, I have been noticing that my emails stop sending/receiving

    Then I have to login to my admin panel & check under Monitor

    1. Show Mail Queue - Most of the time I find 4 or 5 mails

    2. Show Mail-warn log - Errors are

    Jul 15 10:07:27 server1 amavis[2510]: (!)Net::Server: 2012/07/15-10:07:27 Bad fork [Cannot allocate memory]\n at line 166 in file /usr/share/perl5/Net/Server/PreForkSimple.pm
    Jul 15 12:27:05 server1 amavis[5479]: (05479-01) (!!)file(1) utility (/usr/bin/file) FAILED: run_command: can't fork: Cannot allocate memory at /usr/sbin/amavisd-new line 3077.

    3. Show Mail Error log - Errors are

    Jul 15 12:27:05 server1 amavis[5479]: (05479-01) (!!)file(1) utility (/usr/bin/file) FAILED: run_command: can't fork: Cannot allocate memory at /usr/sbin/amavisd-new line 3077.

    Then I always login to my Terminal & give following commands

    root@server1:~# /etc/init.d/amavis restart
    Stopping amavisd: (not running).
    Starting amavisd: amavisd-new.
    root@server1:~#

    Since amavisd not running then I always try

    root@server1:~# /etc/init.d/amavis start
    Starting amavisd: amavisd-new.
    root@server1:~#

    Then I do

    root@server1:~# /etc/init.d/apache2 restart
    Restarting web server: apache2 ... waiting .
    root@server1:~#

    Then my Mail works But this problem is quite presistent for past over 2 weeks

    Please advice, where could be the problem, from time to time I keep running

    apt-get update as well as apt-get upgrade

    Thanks
     
  2. rosehosting

    rosehosting Member

    The problem looks like is that your system is running out of memory. You need to find out what is filling up the memory using free, top, ps etc....

    the following one-liner will give you the top 30 most RAM hungry processes:

    Code:
    while read command percent rss; do if [[ "${command}" != "COMMAND" ]]; then rss="$(bc <<< "scale=2;${rss}/1024")"; fi; printf "%-26s%-8s%s\n" "${command}" "${percent}" "${rss}"; done < <(ps -A --sort -rss -o comm,pmem,rss|head -31)
     
  3. abintipl

    abintipl New Member

    Memory

    Here is the output for memory usage



    root@server1:~# free -t -m
    total used free shared buffers cached
    Mem: 508 478 30 0 3 53
    -/+ buffers/cache: 422 86
    Swap: 0 0 0
    Total: 508 478 30
    root@server1:~#

    top - 09:12:50 up 11 days, 19:00, 1 user, load average: 0.00, 0.11, 0.08
    Tasks: 94 total, 1 running, 93 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 521052k total, 478448k used, 42604k free, 3280k buffers
    Swap: 0k total, 0k used, 0k free, 59444k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    31676 root 20 0 70588 1232 492 S 1.0 0.2 0:00.34 sshd
    10917 root 20 0 19072 1348 1016 R 0.3 0.3 0:00.12 top
    1 root 20 0 8356 184 56 S 0.0 0.0 0:09.86 init
    2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
    3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
    4 root 20 0 0 0 0 S 0.0 0.0 0:00.80 ksoftirqd/0
    5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
    6 root 20 0 0 0 0 S 0.0 0.0 1:31.65 events/0
    7 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuset
    8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper
    9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
    10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
    11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
    12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xenwatch
    13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xenbus
    14 root 20 0 0 0 0 S 0.0 0.0 0:01.66 sync_supers
    15 root 20 0 0 0 0 S 0.0 0.0 0:01.82 bdi-default
    16 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The min. recommended memory size for a full setup is 750MB, the recommende size is 2GB. You server ahs just 512MB, so its normal that processes run out of memory.

    Either you increase the memory of your server or you disable some applications like the email scanner.
     
  5. abintipl

    abintipl New Member

    Memory

    Sir,

    I have increased memory my cloud server from 512 to 756

    I have restarted apachc2

    Mail warn log is as under

    Jul 20 08:14:53 server1 amavis[9396]: (!)Net::Server: 2012/07/20-08:14:53 Couldn't fork: [Cannot allocate memory]\n\n at line 293 in file /usr/share/perl5/Net/Server.pm
    Jul 20 10:29:25 server1 dovecot: dovecot: Killed with signal 15 (by pid=12518 uid=0 code=kill)
    Jul 20 10:30:02 server1 postfix/postqueue[1499]: warning: Mail system is down -- accessing queue directly
     
  6. Sir Henry

    Sir Henry Member

    You do not have any swap space configured. Check your settings in /etc/fstab for swap space and execute 'swapon -s'.
     
    Last edited: Jul 20, 2012
  7. abintipl

    abintipl New Member

    Memory

    Sir,

    It was created when I had set up server

    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    /dev/xvda1 / ext3 errors=remount-ro,usrjquota=aquota.user,
    grpjquota=aquota.group,jqfmt=vfsv0 0 1
    ~
    ~
    ~
    ~
    ~
    ~
    ~
     
  8. Sir Henry

    Sir Henry Member

    Did you follow the tutorial for setting up your disk partitions?

    Or else why didn't you configure any swap?

    Can you post the output of 'fdisk -l' please.
     
  9. abintipl

    abintipl New Member

    Memory

    Sir,

    Here is the output

    root@server1:~# fdisk -l

    Disk /dev/xvda1: 5368 MB, 5368709120 bytes
    255 heads, 63 sectors/track, 652 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Disk /dev/xvda1 doesn't contain a valid partition table
    root@server1:~#



    I did follow the tutorial

    http://www.howtoforge.com/perfect-server-debian-squeeze-with-bind-and-dovecot-ispconfig-3-p4

    Edit /etc/fstab. Mine looks like this (I added ,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 to the partition with the mount point /):
     
  10. Sir Henry

    Sir Henry Member

    I am afraid you deleted the swap line from /etc/fstab when you edited it.

    The "Guided Method - Use entire disk" does create a swap partition, as you can see on page 2 of the tutorial.

    I am not quite sure if I can help further as this might be related to virtualisation. But I wonder where your partition table is.

    Please post the output of
    Code:
    cat /proc/partitions
    and
    Code:
    fdisk -l /dev/xvda
    Then we might see...
     
  11. abintipl

    abintipl New Member

    DIsk

    Sir,

    root@server1:~# cat /proc/partitions
    major minor #blocks name

    202 1 5242880 xvda1
    root@server1:~#

    And

    root@server1:~# fdisk -l /dev/xvda
    root@server1:~#

    There is no output for fdisk -l /dev/xvda
     
  12. Sir Henry

    Sir Henry Member

    Sorry, I can't help any further. I do not know why you have only one partition and no swap.

    Is reinstalling an option for you? Or else you might want to wait for a better expert...
     
  13. abintipl

    abintipl New Member

    Option

    Dear Sir,

    I wait for an Expert's answer.

    I can reinstall if there's no option

    Further, I am on VPS & whenever I run apt-get update / upgrade some AMD error is shown & remember I did some changes while correcting the error, which is shown below in "apt-get upgrade"

    apt-get update

    Reading package lists... Done
    W: Duplicate sources.list entry http://security.debian.org/ squeeze/updates/main
    amd64 Packages (/var/lib/apt/lists/security.debian.org_dists_squeeze_updates_ma
    in_binary-amd64_Packages)
    W: You may want to run apt-get update to correct these problems
    root@server1:~#

    apt-get upgrade

    Do you want to continue [Y/n]? Y
    Setting up linux-image-2.6.32-5-amd64 (2.6.32-45) ...
    Running depmod.
    Running update-initramfs.
    update-initramfs: Generating /boot/initrd.img-2.6.32-5-amd64
    Examining /etc/kernel/postinst.d.
    run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-amd64 /boot
    /vmlinuz-2.6.32-5-amd64
    run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-amd64 /boot/
    vmlinuz-2.6.32-5-amd64
    Searching for GRUB installation directory ... found: /boot/grub
    Searching for default file ... Generating /boot/grub/default file and setting th
    e default boot entry to 0
    entry not specified.
    run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
    Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.3
    2-5-amd64.postinst line 799.
    dpkg: error processing linux-image-2.6.32-5-amd64 (--configure):
    subprocess installed post-installation script returned error exit status 2
    Setting up linux-image-2.6.32-5-xen-amd64 (2.6.32-45) ...
    configured to not write apport reports
    Running depmod.
    Running update-initramfs.
    update-initramfs: Generating /boot/initrd.img-2.6.32-5-xen-amd64
    Examining /etc/kernel/postinst.d.
    run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-xen-amd64 /
    boot/vmlinuz-2.6.32-5-xen-amd64
    run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-xen-amd64 /b
    oot/vmlinuz-2.6.32-5-xen-amd64
    Searching for GRUB installation directory ... found: /boot/grub
    Searching for default file ... Generating /boot/grub/default file and setting th
    e default boot entry to 0
    entry not specified.
    run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
    Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.3
    2-5-xen-amd64.postinst line 799.
    dpkg: error processing linux-image-2.6.32-5-xen-amd64 (--configure):
    subprocess installed post-installation script returned error exit status 2
    configured to not write apport reports
    Errors were encountered while processing:
    linux-image-2.6.32-5-amd64
    linux-image-2.6.32-5-xen-amd64
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    root@server1:~#
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

  15. abintipl

    abintipl New Member

    Swap

    Till Sir,

    I am on cloud server and have done as per instructions.

    To be sure, I just pasting output of vi/etc/fstab for your confirmation. After making changes, I have rebooted my server

    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc /swapfile1 swap swap defaults 0
    0
    /dev/xvda1 / ext3 errors=remount-ro,usrjquota=aquota.user,
    grpjquota=aquota.group,jqfmt=vfsv0 0 1
    ~
    ~
    ~
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok,so your provider vanishes all config changes after a reboot. Please run:

    swapon /swapfile1

    again and then post the output of:

    free -m
     
  17. Sir Henry

    Sir Henry Member

    It is not the provider - he mixed the swap line into the /proc line !
     
  18. abintipl

    abintipl New Member

    Swap

    root@server1:~# free -m
    total used free shared buffers cached
    Mem: 764 748 16 0 5 193
    -/+ buffers/cache: 549 215
    Swap: 511 0 511
    root@server1:~#
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    =k, the swap is active. Does your server has a file /etc/rc.local? If yes, add the command:

    swapon /swapfile1

    to that file. so that the swap gets activated after a reboot.
     
  20. abintipl

    abintipl New Member

    swap

    Sir,

    I do have /etc/rc.local & have added the line

    output is as under

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.

    swapon /swapfile1

    exit 0
    ~
    ~
     

Share This Page