Bug 317071 - fails to write pid file if server user changes
fails to write pid file if server user changes
Status: CLOSED WONTFIX
Product: 389
Classification: Community
Component: Admin (Show other bugs)
1.1.0
All Linux
low Severity low
: ---
: ---
Assigned To: Rich Megginson
Chandrasekar Kannan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-03 12:42 EDT by jmccann
Modified: 2015-01-14 18:20 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-30 12:31:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jmccann 2007-10-03 12:42:42 EDT
Description of problem:
If for whatever reason the server user changes (in my case it was rerunning the
the initial setup tool) the init script will report that the server fails to
start because it doesn't have permission to write the pid file.

My /var/run/dirsrv directory was owned by nobody:nobody and I had changed DS to
run as dirsrv.  I notice that the initscript in CVS has a little bit more logic
but not quite enough to fix this problem.

Maybe just something like:

Index: initscript.in
===================================================================
RCS file: /cvs/dirsec/adminserver/wrappers/initscript.in,v
retrieving revision 1.1
diff -p -u -8 -r1.1 initscript.in
--- initscript.in       15 Jun 2007 17:13:02 -0000      1.1
+++ initscript.in       3 Oct 2007 16:41:26 -0000
@@ -58,19 +58,17 @@ fix_pid_dir_ownership()
         dirowner=`ls -ld $piddir | awk '{print $3}'`
         dirgrp=`ls -ld $piddir | awk '{print $4}'`
         if [ "$owner" != "$dirowner" ]; then
             groups $owner | grep $dirgrp > /dev/null 2>&1
             rc=$?
             if [ $rc -eq 0 ]; then
                 chmod 770 $piddir
             else
-                echo_n "$piddir is not writable for $owner"
-                failure; echo
-                exit 1
+                chown $owner $piddir
             fi
         fi
     else
         mkdir -p $piddir
         owner=`grep \^nsslapd-localuser $1/dse.ldif | awk '{print $2}'`
         if [ -n "$owner" ] ; then
             chown $owner $piddir
             chmod 700 $piddir
Comment 1 Rich Megginson 2007-10-05 13:07:55 EDT
What version of Fedora DS was this?  Note that this is the admin server init
script, not the directory server init script.  Did you actually build and
install the fedora-ds-admin (dirsrv-admin) package?
Comment 2 jmccann 2007-10-05 13:20:17 EDT
I'm using the FDS in Fedora 7.  So my problem is with that version of the init
script.  Then I just tried to find the appropriate file to fix in CVS... looks
like I got the wrong one.  Sorry.  May still make sense though.

I'll make a new patch.
Comment 3 Rich Megginson 2007-10-05 13:26:24 EDT
(In reply to comment #2)
> I'm using the FDS in Fedora 7.  So my problem is with that version of the init
> script.  Then I just tried to find the appropriate file to fix in CVS... looks
> like I got the wrong one.  Sorry.  May still make sense though.

Ok.  The one in Fedora 7 is the 1.1 candidate.  In CVS this is
/cvs/dirsec/ldapserver/wrappers/initscript.in

> 
> I'll make a new patch.

Comment 4 Martin Kosek 2012-01-04 08:45:41 EST
Upstream ticket:
https://fedorahosted.org/389/ticket/125

Note You need to log in before you can comment on or make changes to this bug.