[PKG-Openstack-devel] systemd support for OpenStack
Thomas Goirand
zigo at debian.org
Tue Jul 15 06:44:53 UTC 2014
On 07/15/2014 01:55 AM, gustavo panizzo <gfa> wrote:
> On 07/14/2014 01:46 PM, stanzgy wrote:
>> Hi zigo, I agreed with Gustavo to use the EnvironmentFile to deal with
>> the logging facility.
>> But after some failed tries I found it seems impossible to use
>> EnvironmentFile to handle this.
>> The syntax EnvironmentFile using[1] is incompatible with bash(especially
>> when dealing with
>> quotes and spaces),
>
> newer versions of systemd support shell like quoting in EnvironmentFile,
> 204-14 does it. i just checked with ssh service file
>
>
> and seems have no control statements like if or
>> while. So the following
>
> :(
>
>> code couldn't be done with systemd service file AFAIK.
>>
>> [ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
>> [ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file
>> /var/log/nova/$NAME.log"
>
>>
>> IMHO a workaround is to always enable logfile and offer some options in
>> /etc/default
>> to decide whether to enable syslog.
> Agreed
>
> i think we could
>
> 1) add a postinst script to parse, and modify, /etc/default/openstack
> and /etc/default/nova.
> logging options will end in $DAEMON_ARGS which we could consume from
> service and init.d files
>
> 2) launch the service from a shell wrapper :(
>
>
> both approaches will suit me, i need them because
> https://github.com/saltstack/salt/issues/11900
>
> i do prefer the postinst path
The postinst path doesn't work, because you should be able to just edit
/etc/default/<name> or /etc/default/openstack, restart the daemon, and
your new option tweaks should be taken care of. Postinst doesn't run
when you start the service.
So the only option we have remaining is a kind of wrapper somehow. I've
heard that there's an option in systemd to run some kind of scripting,
do you guys know about that? Or is it just writing a wrapper in the
ExecStart?
Cheers,
Thomas
More information about the Openstack-devel
mailing list