<div dir="ltr">Hi,<br><br>I used following method:<br><br>pgpool.conf:<div>...<br><div>ping_path = &#39;/bin&#39;</div><div>ifconfig_path = &#39;/usr/bin&#39;</div><div>if_up_cmd = &#39;sudo ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0&#39;<br>
</div><div>if_down_cmd = &#39;sudo ifconfig eth0:0 down&#39;<br></div><div>arping_path = &#39;/usr/bin&#39;<br></div><div>arping_cmd = &#39;sudo arping -U $_IP_$ -w 1&#39;<br></div><div>....<br><br></div><div style>and a string in /etc/sudoers. I just don&#39;t like this decision but it works. It&#39;s better than run daemon as root.<br>
<br>Thanks, Yuriy</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/11 Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So your idea is edit /etc/sudoers to allow to execute via sudo arping<br>
and ifconfig without password? I&#39;m not a security expert but this<br>
sounds like a good idea to me.<br>
<div class="im"><br>
&gt; Hi,<br>
&gt;<br>
&gt; I am trying to avoid running pgpool as root but it seems it expects you to use a setuid root executable (which I&#39;m not comfortable with).  I&#39;ve come up with a solution which I think should be acceptable but does not currently work because the code will exit based on what it thinks is required.<br>

&gt;<br>
&gt; I feel like this should be decided by the administrator via either compile time option and/or command line argument and or configuration param.<br>
<br>
</div>Agreed. Do you think which option is the best?<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; Here&#39;s what I&#39;ve done:<br>
&gt;<br>
&gt; ifconfig_path = &#39;/var/lib/postgresql/bin&#39;<br>
&gt; if_up_cmd = &#39;pg_ifconfig eth0:2 $_IP_$ 255.255.255.0 up&#39;<br>
&gt; if_down_cmd = &#39;pg_ifconfig eth0:2 $_IP_$ 255.255.255.0 down&#39;<br>
&gt; arping_path = &#39;/var/lib/postgresql/bin&#39;           # arping command path<br>
&gt; arping_cmd = &#39;pg_arping $_IP_$ 1&#39;<br>
&gt;<br>
&gt; created 2 scripts (pg_arping/pg_ifconfig) which execute the commands required via sudo:<br>
&gt;<br>
&gt; $ cat pg_arping<br>
&gt; #!/bin/bash<br>
&gt; [ $# -ne 2 ] &amp;&amp; echo &quot;$0 ip.add.re.ss timeout&quot; &amp;&amp; exit 3<br>
&gt; ip=$1<br>
&gt; timeout=$2<br>
&gt; /usr/bin/sudo /usr/sbin/arping -U $ip -w $timeout<br>
&gt;<br>
&gt; $ cat pg_ifconfig<br>
&gt; #!/bin/bash<br>
&gt; [ $# -ne 4 ] &amp;&amp; echo &quot;$0 interface ip.add.re.ss netmask [up|down]&quot; &amp;&amp; exit 3<br>
&gt; iface=$1<br>
&gt; ip=$2<br>
&gt; netmask=$3<br>
&gt; action=$4<br>
&gt; /usr/bin/sudo /sbin/ifconfig $iface inet $ip netmask $netmask $action<br>
&gt;<br>
&gt;<br>
&gt; FYI to get this working I simply removed the code I didn&#39;t like, but I&#39;m not a huge fan of this either:<br>
&gt;<br>
&gt; main.c:<br>
&gt;<br>
&gt;                         /* check root<br>
&gt;                         if (geteuid() != 0)<br>
&gt;                         {<br>
&gt;                                 pool_error(&quot;watchdog must be started under the privileged user ID to up/down virtual network interface.&quot;);<br>
&gt;                                 pool_shmem_exit(1);<br>
&gt;                                 exit(1);<br>
&gt;                         } */<br>
&gt;<br>
&gt; --kyleo<br>
&gt; _______________________________________________<br>
&gt; pgpool-general mailing list<br>
&gt; <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
</div></div></blockquote></div><br></div>