<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">For the record too, this release of caldavd (4.2) has been working flawlessly on MacOS 10.6.8 running on a Mac Mini serving 6 clients for the past 3 months and may very well have saved my marriage :)<div><br></div><div>For anyone interested in a simple way to autostart the daemon on a MacOS client machine (not MacOS Server), I gave up on trying to use launchctl and just wrote a simple shell script I run as a "login item" from an account that's configured for auto-login on the server:</div><div><br></div><div><div>#!/bin/sh</div><div><br></div><div>cd ~matinee/CalendarServer/tags/release/4.2/</div><div>./run -nd</div></div><div><br></div><div>Brut force, but it works fine if you have an auto-login configured. In my case the machine is my home theater media server and it's configured to boot into Front Row using a restricted account named "matinee" that doesn't have permission to do anything. When I talked about running with different "permissions" this is what I meant. The original install was done from an admin level account, which is why I wanted to move it.</div><div><div><br></div><div>Scott.</div><div><br><div><div>On Sep 16, 2013, at 11:50 AM, Andre LaBranche wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Forgot to cc the list on the resolution.<div><br></div><div>-dre</div><div><br><div><div>On Sep 16, 2013, at 10:47 AM, Andre LaBranche &lt;<a href="mailto:dre@apple.com">dre@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Sep 14, 2013, at 9:41 PM, Scott Cherf &lt;<a href="mailto:cherf@ambient-light.com">cherf@ambient-light.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Andre -<div><br></div><div>Thanks for the step by step guide, it all makes sense and like you I don't have postgres installed systemwide either. In my install it's in the directory above the CalendarServer (version 4.2) in CalendarServer/tags/release. Using the commands from that location gives me an error:</div><div><br></div><div><div>psql: could not connect to server: No such file or directory</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Is the server running locally and accepting</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>connections on Unix domain socket "/tmp/.s.PGSQL.5432"?&nbsp;</div><div><br></div><div><br></div><div>The CalendarServer is running and so is postgres but the socket mentioned in the error doesn't exist. Is there a way from me to tell psql how to connect to the DB?</div></div></div></blockquote><div><br></div><div>Yep; that /tmp location is the default for postgres, but we stash it someplace a bit more unique. Start the service, then get a list of running postgres processes:</div><div><br></div><div>ps auxww | grep -i postgres</div><div><br></div><div>You should see one something like this:</div><div><br></div><div><div style="margin: 0px; font-family: Monaco;">... /Volumes/whatever/Users/andre/work/icalserver/trunk/postgresql-9.2.4/_root/bin/postgres -c listen_addresses= -k /tmp/ccs_postgres_6c305e5a2a6852bf7f384e044de707ec -c shared_buffers=49 -c max_connections=33 -c standard_conforming_strings=on</div></div><div><br></div><div>The value after the -k switch is the path to our postgres socket file, which you can use as the value for the -h option of postgres command line tools. For example:</div><div><br></div><div><div style="margin: 0px; font-family: Monaco;"><span style="color: #afad24">andre</span><span style="color: #34bd26">@</span><span style="color: #cbcbcb">xomg</span><span style="color: #34bd26">[postgresql-9.2.4/_root]</span>./bin/psql -U caldav -h /tmp/ccs_postgres_6c305e5a2a6852bf7f384e044de707ec --list</div><div style="margin: 0px; font-family: Monaco;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List of databases</div><div style="margin: 0px; font-family: Monaco;">&nbsp;&nbsp; Name&nbsp; &nbsp; | Owner&nbsp; | Encoding | &nbsp; Collate &nbsp; |&nbsp; &nbsp; Ctype&nbsp; &nbsp; | Access privileges&nbsp;</div><div style="margin: 0px; font-family: Monaco;">-----------+--------+----------+-------------+-------------+-------------------</div><div style="margin: 0px; font-family: Monaco;">&nbsp;caldav&nbsp; &nbsp; | caldav | UTF8 &nbsp; &nbsp; | en_US.UTF-8 | en_US.UTF-8 |&nbsp;</div><div style="margin: 0px; font-family: Monaco;">&nbsp;postgres&nbsp; | caldav | UTF8 &nbsp; &nbsp; | en_US.UTF-8 | en_US.UTF-8 |&nbsp;</div><div style="margin: 0px; font-family: Monaco;">&nbsp;template0 | caldav | UTF8 &nbsp; &nbsp; | en_US.UTF-8 | en_US.UTF-8 | =c/caldav&nbsp; &nbsp; &nbsp; &nbsp; +</div><div style="margin: 0px; font-family: Monaco;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | caldav=CTc/caldav</div><div style="margin: 0px; font-family: Monaco;">&nbsp;template1 | caldav | UTF8 &nbsp; &nbsp; | en_US.UTF-8 | en_US.UTF-8 | =c/caldav&nbsp; &nbsp; &nbsp; &nbsp; +</div><div style="margin: 0px; font-family: Monaco;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | caldav=CTc/caldav</div><div style="margin: 0px; font-family: Monaco;">(4 rows)</div><div style="margin: 0px; font-family: Monaco;"><br></div><div style="margin: 0px; font-family: Monaco;">HTH,</div><div style="margin: 0px; font-family: Monaco;">-dre</div><div style="margin: 0px; font-family: Monaco;"><br></div></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>This is a MacOS 10.6.8 installation.</div><div><br></div><div>Regards,</div><div>Scott.</div><div><br></div><div><div>On Sep 13, 2013, at 11:30 AM, Andre LaBranche wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Sep 13, 2013, at 8:26 AM, Scott Cherf &lt;<a href="mailto:cherf@ambient-light.com">cherf@ambient-light.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Does anyone have a cheap trick for adding a "role" to the postgres DB CalendarServer uses? I installed the server under one user ID and wanted to move it to another but had to export the data, reinstall then import so I could run it with different permissions. There must be a simple way to just add a new role to the DB but it wasn't obvious?</div></blockquote><div><br></div><div>Official docs are here:&nbsp;<a href="http://www.postgresql.org/docs/9.2">http://www.postgresql.org/docs/9.2</a></div><div><br></div><div>It’s hard for me to predict what your exact steps would need to be, but one simple approach would be:</div><div><br></div><div>* create the new user (role) in postgres</div><div>* grant the new user the same rights as the existing user</div><div><br></div><div>Example below. Note that in this example, I don’t have postgres installed system-wide (it’s installed to ~/pg), which is why I’m saying ./bin/psql instead of just psql. YMMV. I’m also not setting any passwords for the new role; if your postgres service can be reached over the network, you may want passwords.</div><div><br></div><div># First, list the current roles.</div><div><br></div><div><div style="margin: 0px; font-family: Menlo;"><span style="color: #34bbc7">{38} </span><span style="color: #afad24">admin</span>@<span style="color: #cbcbcb">linuxbuilder </span><span style="color: #34bbc7">[</span>~/pg<span style="color: #34bbc7">]</span><span style="color: #c33720"><b> % </b></span>./bin/psql template1 -c '\du'</div><div style="margin: 0px; font-family: Menlo;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List of roles</div><div style="margin: 0px; font-family: Menlo;">&nbsp;Role name | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Attributes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Member of&nbsp;</div><div style="margin: 0px; font-family: Menlo;">-----------+------------------------------------------------+-----------</div><div style="margin: 0px; font-family: Menlo;">&nbsp;admin &nbsp; &nbsp; | Superuser, Create role, Create DB, Replication | {}</div><div style="margin: 0px; font-family: Menlo;">&nbsp;caldav&nbsp; &nbsp; | Superuser, Create role, Create DB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | {}</div><div style="margin: 0px; font-family: Menlo;"><br></div><div style="margin: 0px; font-family: Menlo;">Let’s assume caldav is the ‘old’ account.</div><div style="margin: 0px; font-family: Menlo;"><br></div><div style="margin: 0px; font-family: Menlo;"><br></div><div style="margin: 0px; font-family: Menlo;"># Create a new role, validate it</div><div style="margin: 0px; font-family: Menlo;"><div style="margin: 0px;"><span style="color: #34bbc7"><br></span></div><div style="margin: 0px;"><span style="color: #34bbc7">{39} </span><span style="color: #afad24">admin</span>@<span style="color: #cbcbcb">linuxbuilder </span><span style="color: #34bbc7">[</span>~/pg<span style="color: #34bbc7">]</span><span style="color: #34bd26"> % </span>./bin/createuser newman &nbsp; &nbsp; &nbsp;</div><div style="margin: 0px;"><span style="color: #34bbc7">{40} </span><span style="color: #afad24">admin</span>@<span style="color: #cbcbcb">linuxbuilder </span><span style="color: #34bbc7">[</span>~/pg<span style="color: #34bbc7">]</span><span style="color: #34bd26"> % </span>./bin/psql template1 -c '\du'</div><div style="margin: 0px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List of roles</div><div style="margin: 0px;">&nbsp;Role name | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Attributes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Member of&nbsp;</div><div style="margin: 0px;">-----------+------------------------------------------------+-----------</div><div style="margin: 0px;">&nbsp;admin &nbsp; &nbsp; | Superuser, Create role, Create DB, Replication | {}</div><div style="margin: 0px;">&nbsp;caldav&nbsp; &nbsp; | Superuser, Create role, Create DB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | {}</div><div style="margin: 0px;">&nbsp;newman&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | {}</div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"># Give newman the same access as caldav, validate it.</div><div style="margin: 0px;"><div style="margin: 0px;"><span style="color: #34bbc7"><br></span></div><div style="margin: 0px;"><span style="color: #34bbc7">{41} </span><span style="color: #afad24">admin</span>@<span style="color: #cbcbcb">linuxbuilder </span><span style="color: #34bbc7">[</span>~/pg<span style="color: #34bbc7">]</span><span style="color: #34bd26"> % </span>./bin/psql template1 -c 'grant caldav to newman'</div><div style="margin: 0px;">GRANT ROLE</div><div style="margin: 0px;"><span style="color: #34bbc7">{42} </span><span style="color: #afad24">admin</span>@<span style="color: #cbcbcb">linuxbuilder </span><span style="color: #34bbc7">[</span>~/pg<span style="color: #34bbc7">]</span><span style="color: #34bd26"> % </span>./bin/psql template1 -c '\du'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div style="margin: 0px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List of roles</div><div style="margin: 0px;">&nbsp;Role name | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Attributes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Member of&nbsp;</div><div style="margin: 0px;">-----------+------------------------------------------------+-----------</div><div style="margin: 0px;">&nbsp;admin &nbsp; &nbsp; | Superuser, Create role, Create DB, Replication | {}</div><div style="margin: 0px;">&nbsp;caldav&nbsp; &nbsp; | Superuser, Create role, Create DB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | {}</div><div style="margin: 0px;">&nbsp;newman&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | {caldav}</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">Note that newman is now shown as a member of caldav. This means newman is allowed to do all the things that the caldav role can do. You don’t need to delete the caldav role.</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">Also, be advised that postgres roles and permissions are not at all related to filesystem permissions or system user accounts; except that if you don’t supply a postgres username when connecting, it will pick your current system user account name as the default.</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">HTH,</div><div style="margin: 0px;">-dre</div></div></div></div></div></div></blockquote></div><br><div>
<div>Regards,<br>Scott Cherf<br><br>Villa Montagne Equestrian B&amp;B<br><br>28495 Big Basin Way,<br>Boulder Creek, CA<br>95006<br><br><a href="http://www.villamontagne.us.com/">www.villamontagne.us.com</a><br></div>
</div>
<br></div></blockquote></div><br></div></blockquote></div><br></div></div>_______________________________________________<br>calendarserver-users mailing list<br><a href="mailto:calendarserver-users@lists.macosforge.org">calendarserver-users@lists.macosforge.org</a><br><a href="https://lists.macosforge.org/mailman/listinfo/calendarserver-users">https://lists.macosforge.org/mailman/listinfo/calendarserver-users</a><br></blockquote></div><br></div></div></body></html>