iconv in the ISPConfig chrooted environment

Discussion in 'Installation/Configuration' started by dimas, Aug 26, 2008.

  1. dimas

    dimas Member

    Please kindly help to set up iconv to work in the ISPConfig chrooted environment on Debian Etch.

    Like with other programs I just added


    to the APPS line in /root/ispconfig/scripts/shell/create_chroot_env.sh

    and then enabled shell access for the site where iconv is needed.

    Well, iconv IS copied and that's fine but apparently some libraries are not copied in the process - so when I type "iconv -l" from the user's shell, the list of supported encodings is considerably smaller that the list that I get if I type the same as root.

    Please kindly advise what I have to add to "create_chroot_env.sh" in order to get all the available encodings for iconv (most important for me is windows-1251)?
  2. dimas

    dimas Member

    Well, I've solved this problem myself, but another one's cropped up. I'll start with the solution to the first one.

    I used

    strace iconv -f windows-1251 -t utf-8

    as root to check what system calls iconv makes and so discovered that iconv makes use of files in /usr/lib/gconv/

    After this it was a simple matter to add

    mkdir /usr/lib/gconv


    cp /usr/lib/gconv/* usr/lib/gconv

    to "create_chroot_env.sh"

    - so now iconv works in the chrooted environment.

    However, there is another problem. I'm using a shell script to download an xml file from another server (the file contains currency exchange rates) and later use it in my flash site (I'm importing this xml file into flash by using XMLConnector, but that's a little beside the point).

    I'm using a shell script named (by me) loadxml.sh, it goes like this:


    wget -q http://www.(anotherserver).com/XML_daily.xml -O XML_daily.xml
    iconv -f windows-1251 -t utf-8 -o /web/kurs.xml XML_daily.xml

    I'm using iconv because the original xml file is in windows-1251, and I need utf-8 for flash.

    Now the problem. If I just type


    from inside the user's shell prompt, the script works as intended.

    However, if I make a cron job (by putting "./loadxml.sh" in the "Command:" line from inside ISPConfig), any file downloaded with wget just can't be moved to /web - and I need it there, otherwise I won't be able to access it from flash.

    wget itself can't download to /web and even mv doesn't work from cron.

    please kindly advise why this is happening...
  3. dimas

    dimas Member

    Well since I'm the administrator of the server, the workaround is to use the regular cron via crontab -e (the shell script works from cron if the crob job is added this way, as root).

    However, I'm still extremely interested to know if it's possible to run it successfully from cron of a user's account...

Share This Page