Re: [CalendarServer-users] CalendarServer fails to run on fresh deb9 install

2018-03-01 Thread Andre LaBranche
Hi,

Replies inline.

> On Mar 1, 2018, at 11:01 AM, Michael Carter  wrote:
> 
> Steps:
> 
> 1) Install and patch up Debian 9
> 2) create a user/group named ‘caldav’
> 3) As that user, check out master from git (git clone 
> https://github.com/apple/ccs-calendarserver.git 
>  master)
> 4) cd to that directory and run ‘bin/develop’
> 5) Copy caldavd-test.plist to caldavd-dev.plist
> 5) Run ‘bin/run -n’
> 6) Notice errors:
> 
> 
> caldav@util:~/CalendarServer/master$ bin/run -n
> /Users/caldav/CalendarServer/master/bin/_py.sh: line 104: [: # 1 "": 
> integer expression expected
> /Users/caldav/CalendarServer/master/bin/_py.sh: line 109: [: # 1 "": 
> integer expression expected
> Using /Users/caldav/CalendarServer/master/.develop/virtualenv/bin/python as 
> Python
> 
> Starting server...
> /usr/bin/python2.7: can't find '__main__' module in ''
> 
> a) No idea what the _py.sh issues are

Most likely something to do with _py.sh not being strictly POSIX compliant. The 
enforcement of POSIX strictness varies by shell and by OS release. For example, 
in Ubuntu 16.x (xenial), when I manually test the cmp_version function from 
_py.sh, it works fine. However, the dash (Debian Almquist shell) man page on 
that host also says:

The current version of dash is in the process of being changed to conform with 
the POSIX 1003.2 and 1003.2a specifications for the shell.

(Notably, xenial is not the most recent Ubuntu release. Also notably... dash 
has no cli option that reports its version number? That's unfortunate...)

ANYWAY: the issue is surely one of these: https://wiki.ubuntu.com/DashAsBinSh

I'll take a pass through and see what I can find...

-dre


> b) Shouldn’t this be running the version of python in the virtualenv? 
> Shouldn’t ‘run’ take care of setting up that envionment? Why am I even seeing 
> /usr/bin/python being called?
> 
> Thanks.
> 
> #mikec
> 
> ___
> calendarserver-users mailing list
> calendarserver-users@lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/calendarserver-users

___
calendarserver-users mailing list
calendarserver-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/calendarserver-users


Re: [CalendarServer-users] CalendarServer fails to run on fresh deb9 install

2018-03-01 Thread Michael Carter
Thanks, Guido..

caldav@util:~/CalendarServer/master$ /bin/bash bin/run -n
/Users/caldav/CalendarServer/master/bin/_py.sh: line 104: [: # 1 "": 
integer expression expected
/Users/caldav/CalendarServer/master/bin/_py.sh: line 109: [: # 1 "": 
integer expression expected
Using /Users/caldav/CalendarServer/master/.develop/virtualenv/bin/python as 
Python

Starting server...
/usr/bin/python2.7: can't find '__main__' module in ''

Same result.

Here’s a snippet of _py.sh that is generating the error:

#
# Compare version numbers
#
cmp_version () {
  local  v="$1"; shift;
  local mv="$1"; shift;

  local vh;
  local mvh;
  local result;

  while true; do
 vh="${v%%.*}"; # Get highest-order segment
mvh="${mv%%.*}";

if [ "${vh}" -gt "${mvh}" ]; then   <— line 104
  result=1;
  break;
fi;

if [ "${vh}" -lt "${mvh}" ]; then
  result=0;
  break;
fi;

#Mikec


 Michael Carter | avidfl...@me.com  | 408.386.0288

> On Mar 1, 2018, at 12:11 PM, Guido Günther  wrote:
> 
> On Thu, Mar 01, 2018 at 11:01:06AM -0800, Michael Carter wrote:
>> Steps:
>> 
>> 1) Install and patch up Debian 9
>> 2) create a user/group named ‘caldav’
>> 3) As that user, check out master from git (git clone 
>> https://github.com/apple/ccs-calendarserver.git master)
>> 4) cd to that directory and run ‘bin/develop’
>> 5) Copy caldavd-test.plist to caldavd-dev.plist
>> 5) Run ‘bin/run -n’
>> 6) Notice errors:
>> 
>> 
>> caldav@util:~/CalendarServer/master$ bin/run -n
>> /Users/caldav/CalendarServer/master/bin/_py.sh: line 104: [: # 1 "": 
>> integer expression expected
>> /Users/caldav/CalendarServer/master/bin/_py.sh: line 109: [: # 1 "": 
>> integer expression expected
> 
> Without having looked at the script at all can you try
> 
>   /bin/bash bin/run -n
> 
> since /bin/sh is dash.
> -- Guido
> 
> 
>> Using /Users/caldav/CalendarServer/master/.develop/virtualenv/bin/python as 
>> Python
>> 
>> Starting server...
>> /usr/bin/python2.7: can't find '__main__' module in ''
>> 
>> a) No idea what the _py.sh issues are
>> b) Shouldn’t this be running the version of python in the virtualenv? 
>> Shouldn’t ‘run’ take care of setting up that envionment? Why am I even 
>> seeing /usr/bin/python being called?
>> 
>> Thanks.
>> 
>> #mikec
>> 
> 
>> ___
>> calendarserver-users mailing list
>> calendarserver-users@lists.macosforge.org
>> https://lists.macosforge.org/mailman/listinfo/calendarserver-users
> 

___
calendarserver-users mailing list
calendarserver-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/calendarserver-users


Re: [CalendarServer-users] CalendarServer fails to run on fresh deb9 install

2018-03-01 Thread Guido Günther
On Thu, Mar 01, 2018 at 11:01:06AM -0800, Michael Carter wrote:
> Steps:
> 
> 1) Install and patch up Debian 9
> 2) create a user/group named ‘caldav’
> 3) As that user, check out master from git (git clone 
> https://github.com/apple/ccs-calendarserver.git master)
> 4) cd to that directory and run ‘bin/develop’
> 5) Copy caldavd-test.plist to caldavd-dev.plist
> 5) Run ‘bin/run -n’
> 6) Notice errors:
> 
> 
> caldav@util:~/CalendarServer/master$ bin/run -n
> /Users/caldav/CalendarServer/master/bin/_py.sh: line 104: [: # 1 "": 
> integer expression expected
> /Users/caldav/CalendarServer/master/bin/_py.sh: line 109: [: # 1 "": 
> integer expression expected

Without having looked at the script at all can you try

   /bin/bash bin/run -n

since /bin/sh is dash.
 -- Guido


> Using /Users/caldav/CalendarServer/master/.develop/virtualenv/bin/python as 
> Python
> 
> Starting server...
> /usr/bin/python2.7: can't find '__main__' module in ''
> 
> a) No idea what the _py.sh issues are
> b) Shouldn’t this be running the version of python in the virtualenv? 
> Shouldn’t ‘run’ take care of setting up that envionment? Why am I even seeing 
> /usr/bin/python being called?
> 
> Thanks.
> 
> #mikec
> 

> ___
> calendarserver-users mailing list
> calendarserver-users@lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/calendarserver-users

___
calendarserver-users mailing list
calendarserver-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/calendarserver-users