directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dima N (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRSERVER-1835) ApacheDS not able to restart/start when the process shown in apacheds-default.pid is not running
Date Tue, 05 Nov 2013 12:02:22 GMT

    [ https://issues.apache.org/jira/browse/DIRSERVER-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13813876#comment-13813876
] 

Dima N commented on DIRSERVER-1835:
-----------------------------------

Here is workaround in Python (I'm just a newbie so code might not be the best but it seems
to work).

Just make sure user running the script has appropriate sudo permissions (I've added next line
to /etc/sudoers):
*username        ALL=(apacheds)  NOPASSWD: ALL*
{code}
#!/usr/bin/env python
import subprocess
import os
import string

def check_apacheds_service():
        global running,pid
        try:
          pid=subprocess.check_output("pidof /opt/apacheds-2.0.0_M14/bin/wrapper",shell=True)
        except subprocess.CalledProcessError:
          #write 'rm .pid' output to /dev/null
          DEVNULL = open(os.devnull, 'wb')
          subprocess.call(["sudo -u apacheds rm /var/lib/apacheds-2.0.0_M14/default/run/apacheds-default.pid"],
stdout=DEVNULL, stderr=DEVNULL,shell=True)
          running=False
        else:
          print 'ApacheDS - default is running (' + string.strip(pid) + ')'
          running=True

if  __name__ == '__main__':
        check_apacheds_service()
        if not running:
          subprocess.call(['sudo -u apacheds /etc/init.d/apacheds-2.0.0_M14-default start'],shell=True)
{code}

> ApacheDS not able to restart/start when the process shown in apacheds-default.pid is
not running
> ------------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1835
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1835
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M11
>         Environment: Linux CentOS
>            Reporter: James C. Wu
>            Priority: Minor
>
> I have a default instance of ApacheDS 2.0.0.M11. 
> I could not restart the apacheDS service using 
> /etc/init.d/apacheds-2.0.0-M11-default restart or /etc/init.d/apacheds-2.0.0-M11-default
start
> after a system reboot. 
> The problem is fixed by deleting the pid stored in the  apacheds-default.pid file /var/lib/apacheds-2.0.0-M11/default/run/apacheds-default.pid



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message