Bug 1211006
Summary: | start/stop/restart-dirsrv utilities should ignore admin-serv directory | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Viktor Ashirov <vashirov> |
Component: | 389-ds-base | Assignee: | Noriko Hosoi <nhosoi> |
Status: | CLOSED ERRATA | QA Contact: | Viktor Ashirov <vashirov> |
Severity: | unspecified | Docs Contact: | |
Priority: | high | ||
Version: | 6.7 | CC: | jgalipea, nkinder, rmeggins, salmy, tlavigne |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | 389-ds-base-1.2.11.15-59.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-07-22 06:37:22 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Viktor Ashirov
2015-04-12 01:37:07 UTC
Indeed, although it stops the DS, but it picks up unnecessary "admin", too... # sh -x stop-dirsrv + getopts d: flag + shift 0 + '[' '' = '' ']' + '[' root = root ']' + initconfig_dir=/etc/sysconfig + '[' 0 -eq 0 ']' + ret=0 + for i in '$initconfig_dir/dirsrv-*' + regex=s,/etc/sysconfig/dirsrv-,,g ++ echo /etc/sysconfig/dirsrv-admin ++ sed -e s,/etc/sysconfig/dirsrv-,,g + inst=admin + echo Stopping instance '"admin"' Stopping instance "admin" + stop_instance admin + SERV_ID=admin + '[' -f /etc/sysconfig/dirsrv-admin ']' + . /etc/sysconfig/dirsrv-admin + PIDFILE=/-admin.pid + test '!' -f /-admin.pid + echo No ns-slapd PID file found. Server is probably not running No ns-slapd PID file found. Server is probably not running + return 2 + '[' 2 -ne 0 ']' + ret=0 + for i in '$initconfig_dir/dirsrv-*' + regex=s,/etc/sysconfig/dirsrv-,,g ... Upstream ticket: https://fedorahosted.org/389/ticket/48148 Build tested: 389-ds-base-1.2.11.15-54.el6.x86_64 start-dirsrv and stop-dirsrv are working fine: [root@rhel6ds ~]# start-dirsrv Starting instance "rhel6ds" [root@rhel6ds ~]# stop-dirsrv Stopping instance "rhel6ds" But restart-dirsrv picks up "admin" anyway: [root@rhel6ds ~]# restart-dirsrv Restarting instance "admin" Restarting instance "rhel6ds" Stopping instance "rhel6ds" Starting instance "rhel6ds" [root@rhel6ds ~]# sh -x restart-dirsrv + getopts d: flag + shift 0 + '[' '' = '' ']' + '[' root = root ']' + initconfig_dir=/etc/sysconfig + '[' 0 -eq 0 ']' + ret=0 + for i in '$initconfig_dir/dirsrv-*' + regex=s,/etc/sysconfig/dirsrv-,,g ++ sed -e s,/etc/sysconfig/dirsrv-,,g ++ echo /etc/sysconfig/dirsrv-admin + inst=admin + echo Restarting instance '"admin"' Restarting instance "admin" + restart_instance admin + SERV_ID=admin + server_already_stopped=0 + /usr/sbin/stop-dirsrv -d /etc/sysconfig admin + status=0 + '[' 0 -eq 1 ']' + '[' 0 -eq 2 ']' + /usr/sbin/start-dirsrv -d /etc/sysconfig admin + status=0 + '[' 0 -eq 1 ']' + return 0 + '[' 0 -ne 0 ']' Also I found another issue when these utilities are run under unprivileged user: [vashirov@rhel6ds ~]$ mkdir /tmp/test && cd /tmp/test [vashirov@rhel6ds test]$ touch foobar [vashirov@rhel6ds test]$ start-dirsrv Instance foobar not found. [vashirov@rhel6ds test]$ sh -x start-dirsrv + '[' -f /etc/sysconfig/dirsrv ']' + . /etc/sysconfig/dirsrv +++ uname -s ++ OS=Linux ++ '[' Linux = SunOS -a -f /usr/lib/libumem.so ']' ++ '[' Linux = SunOS -a -f /usr/lib/64/libumem.so ']' + getopts d: flag + shift 0 + '[' '' = '' ']' + '[' vashirov = root ']' + initconfig_dir=/home/vashirov/.dirsrv + '[' 0 -eq 0 ']' + ret=0 + for i in '$initconfig_dir/dirsrv-*' + regex=s,/home/vashirov/.dirsrv/dirsrv-,,g ++ sed -e s,/home/vashirov/.dirsrv/dirsrv-,,g ++ echo '/home/vashirov/.dirsrv/dirsrv-*' + inst='*' + start_instance foobar + SERV_ID=foobar + shift + '[' foobar == admin ']' + '[' -f /home/vashirov/.dirsrv/dirsrv-foobar ']' + echo Instance foobar not found. Instance foobar not found. + return 1 + '[' 1 -ne 0 ']' + ret=0 + exit 0 Build tested: 389-ds-base-1.2.11.15-55.el6 Under root user: [root@rhel6ds ~]# start-dirsrv Starting instance "rhel6ds" [root@rhel6ds ~]# restart-dirsrv Restarting instance "rhel6ds" Stopping instance "rhel6ds" Starting instance "rhel6ds" [root@rhel6ds ~]# stop-dirsrv Stopping instance "rhel6ds" Under non-root user: [vashirov@rhel6ds ~]$ start-dirsrv [vashirov@rhel6ds ~]$ echo $? 0 [vashirov@rhel6ds ~]$ stop-dirsrv [vashirov@rhel6ds ~]$ echo $? 0 [vashirov@rhel6ds ~]$ restart-dirsrv [vashirov@rhel6ds ~]$ echo $? 0 Marking as VERIFIED. Justification: Defects were reported by covscan in errata. If a customer does not install bash, start|stop|restart dirsrv script does not work due to the shell syntax error. Since these are the basic tools for the directory server, we should fix it. Marking this bug as VERIFIED, since original issue is fixed and these scripts are working with dash (POSIX-compliant implementation of /bin/sh) instead of bash. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1326.html |