Re: Kolab 3.0 on Debian Wheezy: More Issues

Johannes Graumann <[email protected]>
Newsgroups gmane.comp.kde.devel.kolab,gmane.comp.kde.kolab.devel
Message-ID <[email protected]>
Johannes Graumann wrote:

> Torsten Grote wrote:
> 
>> On Wednesday 26 September 2012 15:26:31 Johannes Graumann wrote:
>>> > 2012-09-26 13:02:41,479 pykolab.setup ERROR Could not start and
>>> > configure to start on boot, the directory server service.
>>> 
>>> Also potentially bad. What is it actually trying to/supposed to do? What
>>> file to edit?
>> 
>> This is probably because the setup script checks for /bin/systemctl and
>> /sbin/service but not for /usr/sbin/service where the service command
>> resides on my debian system. The script also tries to call
>> /sbin/chkconfig which does't exist on my system at all.
>> 
>> This also looks like a bug to report. Do you want to do that?
>> 
>> If you know some python, you'll find the script source here:
>>     
>>     http://git.kolab.org/pykolab/tree/pykolab/setup
> 
> I managed to fix that with the patch proposed in
> https://issues.kolab.org/show_bug.cgi?id=1052

As Torsten pointed out in his comment to the patch the right thing to do 
would be something like the following at the top-level of "setup-kolab". I 
have never penetrated python on the object oriented level, so how to make 
'servicestarter', 'runlevelupdater' and 'servicecall' available in the 
"setup_*" modules remains mysterious to me ... I am also unsure how to deal 
with multiple, distribution-specific names for the same daemon/service (e.g. 
'dirsrv.target' and 'dirsrv') in a concise manner ...

Cheers, Joh

if os.path.isfile('/bin/systemctl'):
  servicestarter = ['/bin/systemctl', 'restart', '<REPLACEME>']
elif os.path.isfile('/sbin/service'):
  servicestarter = ['/sbin/service', '<REPLACEME>', 'restart']
elif os.path.isfile('/usr/sbin/service'):
  servicestarter = ['/usr/sbin/service', '<REPLACEME>', 'restart']
else:
  log.error(_("No service starting script available."))

if os.path.isfile('/bin/systemctl'):
  runlevelupdater = ['/bin/systemctl', 'enable', '<REPLACEME>']
elif os.path.isfile('/sbin/chkconfig'):
  runlevelupdater = ['/sbin/chkconfig', '<REPLACEME>', 'on']
elif os.path.isfile('/usr/sbin/update-rc.d'):
  runlevelupdater = ['/usr/sbin/update-rc.d', '<REPLACEME>','defaults'])
else:
  log.error(_("No runlevel updating script available."))

def servicecall(call,service):
  call = [x if x != '<REPLACEME>' else service for x in call]
  subprocess.call(call)

# Where dirsrv is to be started/integrated in the startup sequence one can 
# than say:
servicecall(servicestarter,'dirsrv')
servicecall(runlevelupdater,'dirsrv')
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.