diff mbox

[14/18] Make use of /run depend on systemd

Message ID 1444333491-16265-15-git-send-email-bmarzins@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: Benjamin Marzinski
Headers show

Commit Message

Benjamin Marzinski Oct. 8, 2015, 7:44 p.m. UTC
While there are other ways to decide whether to use /run or /var/run,
I believe this should be good enough, and it uses a Makefile define
that already exists.  If it doesn't work for everyone, I'll switch it
to actually test the directories and add a new define to CFLAGS.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/defaults.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Hannes Reinecke Oct. 12, 2015, 7:09 a.m. UTC | #1
On 10/08/2015 09:44 PM, Benjamin Marzinski wrote:
> While there are other ways to decide whether to use /run or /var/run,
> I believe this should be good enough, and it uses a Makefile define
> that already exists.  If it doesn't work for everyone, I'll switch it
> to actually test the directories and add a new define to CFLAGS.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  libmultipath/defaults.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
> index e2d2779..a313d75 100644
> --- a/libmultipath/defaults.h
> +++ b/libmultipath/defaults.h
> @@ -27,7 +27,11 @@
>  #define MAX_CHECKINT(a)		(a << 2)
>  
>  #define MAX_DEV_LOSS_TMO	0x7FFFFFFF
> +#ifdef USE_SYSTEMD
>  #define DEFAULT_PIDFILE		"/run/multipathd.pid"
> +#else
> +#define DEFAULT_PIDFILE         "/var/run/multipathd.pid"
> +#endif
>  #define DEFAULT_CONFIGFILE	"/etc/multipath.conf"
>  #define DEFAULT_BINDINGS_FILE	"/etc/multipath/bindings"
>  #define DEFAULT_WWIDS_FILE	"/etc/multipath/wwids"
> 
Hmpf. Again.

But yeah, I guess it's okay.

If only systemd would stop moving things around ...

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Zdenek Kabelac Oct. 12, 2015, 7:34 a.m. UTC | #2
Dne 12.10.2015 v 09:09 Hannes Reinecke napsal(a):
> On 10/08/2015 09:44 PM, Benjamin Marzinski wrote:
>> While there are other ways to decide whether to use /run or /var/run,
>> I believe this should be good enough, and it uses a Makefile define
>> that already exists.  If it doesn't work for everyone, I'll switch it
>> to actually test the directories and add a new define to CFLAGS.
>>
>> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
>> ---
>>   libmultipath/defaults.h | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
>> index e2d2779..a313d75 100644
>> --- a/libmultipath/defaults.h
>> +++ b/libmultipath/defaults.h
>> @@ -27,7 +27,11 @@
>>   #define MAX_CHECKINT(a)		(a << 2)
>>
>>   #define MAX_DEV_LOSS_TMO	0x7FFFFFFF
>> +#ifdef USE_SYSTEMD
>>   #define DEFAULT_PIDFILE		"/run/multipathd.pid"
>> +#else
>> +#define DEFAULT_PIDFILE         "/var/run/multipathd.pid"
>> +#endif
>>   #define DEFAULT_CONFIGFILE	"/etc/multipath.conf"
>>   #define DEFAULT_BINDINGS_FILE	"/etc/multipath/bindings"
>>   #define DEFAULT_WWIDS_FILE	"/etc/multipath/wwids"
>>
> Hmpf. Again.
>
> But yeah, I guess it's okay.
>
> If only systemd would stop moving things around ...
>

I assume things like this should be detected at configure time and
used  via  'AC_DEFINE()' m4 macro.
(Check i.e. lvm2 configure.in file)
(As user may wish to even use completely different directory, to
make a parallel usable binary)

Zdenek

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Hannes Reinecke Oct. 12, 2015, 8:35 a.m. UTC | #3
On 10/12/2015 09:34 AM, Zdenek Kabelac wrote:
> Dne 12.10.2015 v 09:09 Hannes Reinecke napsal(a):
>> On 10/08/2015 09:44 PM, Benjamin Marzinski wrote:
>>> While there are other ways to decide whether to use /run or
>>> /var/run,
>>> I believe this should be good enough, and it uses a Makefile define
>>> that already exists.  If it doesn't work for everyone, I'll
>>> switch it
>>> to actually test the directories and add a new define to CFLAGS.
>>>
>>> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
>>> ---
>>>   libmultipath/defaults.h | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
>>> index e2d2779..a313d75 100644
>>> --- a/libmultipath/defaults.h
>>> +++ b/libmultipath/defaults.h
>>> @@ -27,7 +27,11 @@
>>>   #define MAX_CHECKINT(a)        (a << 2)
>>>
>>>   #define MAX_DEV_LOSS_TMO    0x7FFFFFFF
>>> +#ifdef USE_SYSTEMD
>>>   #define DEFAULT_PIDFILE        "/run/multipathd.pid"
>>> +#else
>>> +#define DEFAULT_PIDFILE         "/var/run/multipathd.pid"
>>> +#endif
>>>   #define DEFAULT_CONFIGFILE    "/etc/multipath.conf"
>>>   #define DEFAULT_BINDINGS_FILE    "/etc/multipath/bindings"
>>>   #define DEFAULT_WWIDS_FILE    "/etc/multipath/wwids"
>>>
>> Hmpf. Again.
>>
>> But yeah, I guess it's okay.
>>
>> If only systemd would stop moving things around ...
>>
> 
> I assume things like this should be detected at configure time and
> used  via  'AC_DEFINE()' m4 macro.
> (Check i.e. lvm2 configure.in file)
> (As user may wish to even use completely different directory, to
> make a parallel usable binary)
> 
Yes, please!

Cheers,

Hannes
diff mbox

Patch

diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index e2d2779..a313d75 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -27,7 +27,11 @@ 
 #define MAX_CHECKINT(a)		(a << 2)
 
 #define MAX_DEV_LOSS_TMO	0x7FFFFFFF
+#ifdef USE_SYSTEMD
 #define DEFAULT_PIDFILE		"/run/multipathd.pid"
+#else
+#define DEFAULT_PIDFILE         "/var/run/multipathd.pid"
+#endif
 #define DEFAULT_CONFIGFILE	"/etc/multipath.conf"
 #define DEFAULT_BINDINGS_FILE	"/etc/multipath/bindings"
 #define DEFAULT_WWIDS_FILE	"/etc/multipath/wwids"