<div style="font-family: Verdana; font-size: 12px;">Thanx, here is the output of master proc, and it looks it has all the needed environment:<br><br><font face="courier new">=================================================================================<br>[sonicle@sl imap]$ ps -ef | fgrep master<br>root      3370     1  0 09:26 pts/1    00:00:00 sh /sonicle/scripts/envrun /sonicle/bin/master -C /sonicle/etc/imapd.conf -M /sonicle/etc/cyrus.conf -p /sonicle/var/run/cyrus-master.pid<br>sonicle   3372  3370  0 09:26 pts/1    00:00:00 /sonicle/bin/master -C /sonicle/etc/imapd.conf -M /sonicle/etc/cyrus.conf -p /sonicle/var/run/cyrus-master.pid<br>sonicle   3381  2555  0 09:26 pts/1    00:00:00 fgrep master<br>[sonicle@sl imap]$ strings /proc/3372/environ<br>strings: /proc/3372/environ: Permission denied<br>[sonicle@sl imap]$ sudo strings /proc/3372/environ<br>LDFLAGS=-L/sonicle/lib<br>MANPATH=/sonicle/man:/sonicle/ssl/man:<br>HOSTNAME=sl.sonicle.com<br>SHELL=/bin/bash<br>TERM=xterm<br>HISTSIZE=1000<br>CPPFLAGS=-I/sonicle/include<br>USER=root<br>LD_LIBRARY_PATH=/sonicle/lib:<br>LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:<br>SUDO_USER=sonicle<br>SUDO_UID=501<br>CXXFLAGS=-I/sonicle/include<br>USERNAME=root<br>PATH=/sonicle/scripts:/sonicle/sbin:/sonicle/java/bin:/sonicle/bin:/sonicle/bacula/etc:/sonicle/mysql/bin:/usr/bin:/bin<br>MAIL=/var/spool/mail/sonicle<br>SUDO=sudo<br>PWD=/sonicle/var/log/imap<br>INPUTRC=/etc/inputrc<br>LANG=en_US.UTF-8<br>SHLVL=1<br>SUDO_COMMAND=/sonicle/scripts/envrun /sonicle/bin/master -C /sonicle/etc/imapd.conf -M /sonicle/etc/cyrus.conf -p /sonicle/var/run/cyrus-master.pid<br>HOME=/home/sonicle<br>TERMINFO=/sonicle/lib/terminfo<br>CFLAGS=-I/sonicle/include<br>LOGNAME=root<br>PGDATA=/sonicle/pgdata<br>SUDO_GID=501<br>_=/sonicle/bin/master<br></font>=====================================================================<br><div><br><br>I tried connecting to local port 143, it connects and then waits forever.<br>After that, I get this into imapd.log :<br><br><font face="courier new">Nov  4 09:24:55 sl master[3341]: about to exec /sonicle/bin/imapd<br>Nov  4 09:24:55 sl imap[3341]: incorrect version of Berkeley db: compiled against 4.8.30, linked against 4.3.29<br>Nov  4 09:24:55 sl imap[3341]: Fatal error: wrong db version<br>Nov  4 09:24:55 sl master[2581]: process 3341 exited, signaled to death by 11<br>Nov  4 09:24:55 sl master[2581]: service imap pid 3341 in READY state: terminated abnormally<br></font><br>And then many retries....<br>To me, looks like imapd has no more my LD_LIBRARY_PATH (master has it). <br><font size="1"><br><br>                 -= Mail sent through WebTop2 =-</font>
</div><tt><br><br><br>----------------------------------------------------------------------------------<br><br>Da: Simon Matter &lt;simon.matter@invoca.ch&gt;<br>A: Gabriele Bulfon &lt;gbulfon@sonicle.com&gt; <br>Cc: Clement Hermann (nodens) &lt;nodens2099@gmail.com&gt; info-cyrus@lists.andrew.cmu.edu <br>Data: 4 novembre 2010 7.11.08 CET<br>Oggetto: Re: Running Cyrus Imap under a different user<br><br></tt><blockquote style="border-left: 2px solid rgb(0, 0, 128); margin-left: 5px; padding-left: 5px;"><tt>&gt; Thanx, I understand what you mean, but I&#39;m also supposed to stop and start<br>&gt; the same deamon<br>&gt; from this user again, manually, without su.<br>&gt; I already solved the sudo problem, by wrapping the master launch inside a<br>&gt; shell that will<br>&gt; set the environment for it, and infact it does.<br>&gt; What happens is later, when master forks and change user.<br>&gt; Why is it again loosing my environment?<br><br>That&#39;s really interesting because in my tests it seems to have worked.<br>Could you show us &quot;strings /proc/&lt;PID of master&gt;/environ&quot; and &quot;strings<br>/proc/&lt;PID of imapd&gt;/environ&quot;?<br>BTW, are you running Linux or another *X?<br><br>Simon<br><br>&gt; I just want the binaries to override system libs with mine :)<br>&gt; (of course I could set system environemnt inside master profile or<br>&gt; elsewhere, but this is not what I want to do. I can&#39;t touch any root<br>&gt; system behaviour)<br>&gt; Thanx again :)<br>&gt; Gabriele.<br>&gt; -= Mail sent through WebTop2 =-<br>&gt; ----------------------------------------------------------------------------------<br>&gt; Da: Clement Hermann (nodens)<br>&gt; A: info-cyrus@lists.andrew.cmu.edu<br>&gt; Data: 3 novembre 2010 20.59.53 CET<br>&gt; Oggetto: Re: Running Cyrus Imap under a different user<br>&gt; Le 03/11/2010 18:03, Gabriele Bulfon a &eacute;crit :<br>&gt; Thanx for the quick reply ;)<br>&gt; Yes, environment is correctly exported.<br>&gt; Maybe there is something I can tell to Linux so that it gives my<br>&gt; environement to anyone<br>&gt; changing user to myuser?<br>&gt; You are not supposed to use sudo to do this. The correct way is to login<br>&gt; as root (or change identity via su -, or let init run the init script<br>&gt; for you at startup), and launch the init script to start cyrus master,<br>&gt; which will drop privileges when forking to child processes (imapd,<br>&gt; pop3d, etc).<br>&gt; sudo *will* remove some environment variables, as a security mesure.<br>&gt; It could be that the best way to achieve what you want is to modify an<br>&gt; existing binary package of cyrus imapd for your distribution, modifiying<br>&gt; only the user-related configure options and configuration scripts.<br>&gt; Cheers,<br>&gt; --<br>&gt; Clement Hermann (nodens)<br>&gt; - &quot;L&#39;air pur ? c&#39;est pas en RL, &ccedil;a ? c&#39;est pas hors charte ?&quot;<br>&gt; Jean in L&#39;Histoire des Pingouins, http://tnemeth.free.fr/fmbl/linuxsf/<br>&gt; Vous trouverez ma clef publique sur le serveur public pgp.mit.edu.<br>&gt; Please find my public key on the public keyserver pgp.mit.edu.<br>&gt; ----<br>&gt; Cyrus Home Page: http://www.cyrusimap.org/<br>&gt; List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/<br>&gt; ----<br>&gt; Cyrus Home Page: http://www.cyrusimap.org/<br>&gt; List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/<br><br><br><br><br><br></tt></blockquote></div>