From 3325fed2895f079486b88c65409c73153fec306f Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Fri, 8 Jan 2016 11:29:13 +0200 Subject: Enable control socket when run as init process. * configure.ac (DEFAULT_CONTROL_URL): Rename to DEFAULT_PIES_CONTROL_URL. Change default value. (DEFAULT_INIT_CONTROL_URL): New subst variable. * lib/libpies.h (pies_basic_url_create): New prototype. * lib/url.c (pies_basic_url_create): New function (renamed from pies_url_create). (pies_url_create): Expand variable references in the input string. * src/Makefile.am (AM_CPPFLAGS): Pass DEFAULT_INIT_CONTROL_URL * src/ctl.c (pies_control_url) (ctl_open): Don't exit on errors, return -1 instead. * src/pies.c (default_control_url): New variable. (config_parse): Create default socket url. (pies_control_url): New macro (main): Set environment variable PIES_INSTANCE. Try to open control socket in init process mode as well. * src/pies.h (default_control_url): New extern. (ctl_open): Change prototype. (pies_control_url): Remove. * src/piesctl-cl.opt (parse_options): Set environment variable PIES_INSTANCE. * src/piesctl.c (parse_config): Use pies_url_create and DEFAULT_PIES_CONTROL_URL when falling back to the default socket. --- configure.ac | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 3b34059..d6d4e4f 100644 --- a/configure.ac +++ b/configure.ac @@ -129,8 +129,11 @@ AH_BOTTOM([ # endif ]) -AC_SUBST([DEFAULT_CONTROL_URL],[unix:///tmp/%s.ctl]) -AC_ARG_VAR([DEFAULT_CONTROL_URL], +AC_SUBST([DEFAULT_PIES_CONTROL_URL],['unix:///tmp/$${PIES_INSTANCE}.ctl']) +AC_ARG_VAR([DEFAULT_PIES_CONTROL_URL], + [URL of the default control socket]) +AC_SUBST([DEFAULT_INIT_CONTROL_URL],['unix:///dev/init.ctl']) +AC_ARG_VAR([DEFAULT_INIT_CONTROL_URL], [URL of the default control socket]) IMPRIMATUR_INIT -- cgit v1.2.1