<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 <simon.matter@invoca.ch><br>A: Gabriele Bulfon <gbulfon@sonicle.com> <br>Cc: Clement Hermann (nodens) <nodens2099@gmail.com> 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>> Thanx, I understand what you mean, but I'm also supposed to stop and start<br>> the same deamon<br>> from this user again, manually, without su.<br>> I already solved the sudo problem, by wrapping the master launch inside a<br>> shell that will<br>> set the environment for it, and infact it does.<br>> What happens is later, when master forks and change user.<br>> Why is it again loosing my environment?<br><br>That's really interesting because in my tests it seems to have worked.<br>Could you show us "strings /proc/<PID of master>/environ" and "strings<br>/proc/<PID of imapd>/environ"?<br>BTW, are you running Linux or another *X?<br><br>Simon<br><br>> I just want the binaries to override system libs with mine :)<br>> (of course I could set system environemnt inside master profile or<br>> elsewhere, but this is not what I want to do. I can't touch any root<br>> system behaviour)<br>> Thanx again :)<br>> Gabriele.<br>> -= Mail sent through WebTop2 =-<br>> ----------------------------------------------------------------------------------<br>> Da: Clement Hermann (nodens)<br>> A: info-cyrus@lists.andrew.cmu.edu<br>> Data: 3 novembre 2010 20.59.53 CET<br>> Oggetto: Re: Running Cyrus Imap under a different user<br>> Le 03/11/2010 18:03, Gabriele Bulfon a écrit :<br>> Thanx for the quick reply ;)<br>> Yes, environment is correctly exported.<br>> Maybe there is something I can tell to Linux so that it gives my<br>> environement to anyone<br>> changing user to myuser?<br>> You are not supposed to use sudo to do this. The correct way is to login<br>> as root (or change identity via su -, or let init run the init script<br>> for you at startup), and launch the init script to start cyrus master,<br>> which will drop privileges when forking to child processes (imapd,<br>> pop3d, etc).<br>> sudo *will* remove some environment variables, as a security mesure.<br>> It could be that the best way to achieve what you want is to modify an<br>> existing binary package of cyrus imapd for your distribution, modifiying<br>> only the user-related configure options and configuration scripts.<br>> Cheers,<br>> --<br>> Clement Hermann (nodens)<br>> - "L'air pur ? c'est pas en RL, ça ? c'est pas hors charte ?"<br>> Jean in L'Histoire des Pingouins, http://tnemeth.free.fr/fmbl/linuxsf/<br>> Vous trouverez ma clef publique sur le serveur public pgp.mit.edu.<br>> Please find my public key on the public keyserver pgp.mit.edu.<br>> ----<br>> Cyrus Home Page: http://www.cyrusimap.org/<br>> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/<br>> ----<br>> Cyrus Home Page: http://www.cyrusimap.org/<br>> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/<br><br><br><br><br><br></tt></blockquote></div>