[Freeipa-devel] 389 systemd changes

Rich Megginson rmeggins at redhat.com
Tue Jan 24 00:27:37 UTC 2012


On 01/23/2012 07:37 AM, Alexander Bokovoy wrote:
> On Mon, 23 Jan 2012, Simo Sorce wrote:
>> On Mon, 2012-01-23 at 08:03 +0200, Alexander Bokovoy wrote:
>>> On Sun, 22 Jan 2012, Simo Sorce wrote:
>>>>>> Shouldn't we just 'include' the original file and not copy it ?
>>>>>> If we include it a change in the file will be automatically picked up.
>>>>> We can't due to systemd design and use of it in 389-ds.
>>>>>
>>>>> LimitNOFILE needs to be changed in the service file directly, not in
>>>>> the environment file in /etc/sysconfig or otherwise it will not be
>>>>> picked up by the systemd.
>>>> I am not talking about using /set/sysconfig options, but the .include
>>>> directive for service files.
>>> So, something like this for 389-ds?
>> No, you should include the actual dirsrv default service file (if any,
>> otherwise the sysconfig one might be ok I guess).
> There is /lib/systemd/system/dirsrv at .service. The content below is
> from there and I think there is no need to make .include in a
> /etc/systemd/system/dirsrv at .service copy of it as we can ask Rich to
> make proper change in the original service unit.
>
> This way we only would have settings in /etc/sysconfig (or in
> /etc/dirsrv if that's better) and you'd have no need to intervene into
> /etc/systemd/system. Paths are irrelevant but I'd prefer to use common
> places like /etc/sysconfig.
Done.  This will be going out in 1.2.10.a7.  I also changed the spec 
file so that the .pid files are removed after shutting down the servers 
and before doing the update, so the update to a7 should be smooth even 
if ipa does not amend the service file.

Please test and let me know (once it is available).
>>> ----8<--------8<--------8<---------
>>> [Unit]
>>> Description=389 Directory Server %i.
>>> BindTo=dirsrv.target
>>> After=dirsrv.target
>>>
>>> [Service]
>>> Type=forking
>>> Environment=PIDDIR=/var/run/dirsrv
>>> EnvironmentFile=/etc/sysconfig/dirsrv
>>> EnvironmentFile=/etc/sysconfig/dirsrv-%i
>>> ExecStart=/usr/sbin/ns-slapd -D /etc/dirsrv/slapd-%i -i ${PIDDIR}/slapd-%i.pid -w ${PIDDIR}/slapd-%i.startpid
>>> .include /etc/sysconfig/dirsrv.systemd
>>> ----8<--------8<--------8<---------
>>>
>>> and then with following /etc/sysconfig/dirsrv.systemd:
>>> ----8<--------8<--------8<---------
>>> [Service]
>>> LimitNOFILE=8192
>>> ----8<--------8<--------8<---------
>>>
>>> local overrides can be created?
>> Yes I think if you put directives after the include they will override
>> whatever is in the include.
> Depends on directive.
>
>
>> Also I would put as much as possible in the include file and put in the
>> specific instance files only the parameters we need to override.
> There is no specific instance service unit. There is one service unit
> that processes all instances, that's the whole purpose of @-services
> (dirsrv at .service).
>
>>> It seems to work. You can't use %i macro in .include unfortunately so
>>> any configuration change will be global, not per service instance.
>> That's fine we want to put in there only global configuration anyways,
>> and then override in our specific per instance control files.
> See above. There are no per-instance control files.
>




More information about the Freeipa-devel mailing list