diff mbox

[-,rpcbind] Provide systemd unit files for rpcbind

Message ID 87oa2q14yc.fsf@notabene.neil.brown.name (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown Oct. 12, 2016, 6:01 a.m. UTC
To encourage uniformity across distributions, provide
systemd unit files.

If extra arguments are wanted for rpcbind, a drop-in should be used
to set the Environment= or read and EnvironmentFile=

As the "run" directory could be /run or /var/run we RequiresMountsFor
both of these.

rpcbind.service pulls in rpcbind.socket so that the listening sockets
chosen there will always be used.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 .gitignore                 |  1 +
 Makefile.am                |  4 ++++
 configure.ac               |  7 ++++++-
 systemd/rpcbind.service.in | 17 +++++++++++++++++
 systemd/rpcbind.socket     | 19 +++++++++++++++++++
 5 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 systemd/rpcbind.service.in
 create mode 100644 systemd/rpcbind.socket

hi,
 these are based on the unit files in use a SUSE, though I have made a
 few "improvements".
 If anyone has differences in their distros that you think we should
 have in mainline, I'd love to hear about it.

Thanks,
NeilBrown

Comments

Steve Dickson Nov. 1, 2016, 4:51 p.m. UTC | #1
Hello,

My apologies for not getting to this sooner... 
A rough a couple of weeks... 
On 10/12/2016 02:01 AM, NeilBrown wrote:
> 
> 
> To encourage uniformity across distributions, provide
> systemd unit files.
> 
> If extra arguments are wanted for rpcbind, a drop-in should be used
> to set the Environment= or read and EnvironmentFile=
> 
> As the "run" directory could be /run or /var/run we RequiresMountsFor
> both of these.
Talking with the systemd folks they strongly sugguest we just
use /run (not /var/run) and drop the RequiresMountsFor.

> 
> rpcbind.service pulls in rpcbind.socket so that the listening sockets
> chosen there will always be used.
> 
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  .gitignore                 |  1 +
>  Makefile.am                |  4 ++++
>  configure.ac               |  7 ++++++-
>  systemd/rpcbind.service.in | 17 +++++++++++++++++
>  systemd/rpcbind.socket     | 19 +++++++++++++++++++
>  5 files changed, 47 insertions(+), 1 deletion(-)
>  create mode 100644 systemd/rpcbind.service.in
>  create mode 100644 systemd/rpcbind.socket
> 
> hi,
>  these are based on the unit files in use a SUSE, though I have made a
>  few "improvements".
>  If anyone has differences in their distros that you think we should
>  have in mainline, I'd love to hear about it.
> 
> Thanks,
> NeilBrown
> 
> 
> diff --git a/.gitignore b/.gitignore
> index 321dff64a57d..a8f1fed2acb6 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -27,3 +27,4 @@ rpcbind
>  rpcinfo
>  # cscope database files
>  cscope.*
> +systemd/rpcbind.service
> diff --git a/Makefile.am b/Makefile.am
> index 5ec8cd66b689..43c27100ceae 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -50,6 +50,10 @@ if SYSTEMD
>  AM_CPPFLAGS += $(SYSTEMD_CFLAGS) -DSYSTEMD
>  
>  rpcbind_LDADD += $(SYSTEMD_LIBS)
> +
> +systemdsystemunit_DATA = \
> +	systemd/rpcbind.service \
> +	systemd/rpcbind.socket
>  endif
>  
>  rpcinfo_SOURCES =       src/rpcinfo.c
> diff --git a/configure.ac b/configure.ac
> index af4b74b31c9a..0892d8246a12 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -61,4 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread])
>  
>  AC_CHECK_HEADERS([nss.h rpcsvc/mount.h])
>  
> -AC_OUTPUT([Makefile])
> +# make bindir available for substitution in config file
> +# 2 "evals" needed to expand variable names
> +AC_SUBST([_bindir])
> +AC_CONFIG_COMMANDS_PRE([eval eval _bindir=$bindir])
> +
> +AC_OUTPUT([Makefile systemd/rpcbind.service])
> diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
> new file mode 100644
> index 000000000000..4706b5a77abf
> --- /dev/null
> +++ b/systemd/rpcbind.service.in
> @@ -0,0 +1,17 @@
> +[Unit]
> +Description=RPC Bind
> +Documentation=man:rpcbind(8)
> +DefaultDependencies=no
> +RequiresMountsFor=/var/run /run
> +# Make sure we use the IP addresses listed for
> +# rpcbind.socket, no matter how this unit is started.
> +Wants=rpcbind.socket
> +After=rpcbind.socket
> +
> +[Service]
> +Type=notify
> +# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
> +ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
This macro puts rpcbind in /usr/bin, but in the Red Hat
distros rpcbind lives /usr/sbin. I could easily patch
it to do the right thing... but is this a typo or does 
rpcbind live in /usr/bin in other distros? 

steved.


> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/systemd/rpcbind.socket b/systemd/rpcbind.socket
> new file mode 100644
> index 000000000000..7204c97efa6f
> --- /dev/null
> +++ b/systemd/rpcbind.socket
> @@ -0,0 +1,19 @@
> +[Unit]
> +Description=RPCbind Server Activation Socket
> +DefaultDependencies=no
> +RequiresMountsFor=/var/run /run
> +Wants=rpcbind.target
> +Before=rpcbind.target
> +
> +[Socket]
> +ListenStream=/var/run/rpcbind.sock
> +
> +# RPC netconfig can't handle ipv6/ipv4 dual sockets
> +BindIPv6Only=ipv6-only
> +ListenStream=0.0.0.0:111
> +ListenDatagram=0.0.0.0:111
> +ListenStream=[::]:111
> +ListenDatagram=[::]:111
> +
> +[Install]
> +WantedBy=sockets.target
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
NeilBrown Nov. 1, 2016, 7:57 p.m. UTC | #2
On Wed, Nov 02 2016, Steve Dickson wrote:

> Hello,
>
> My apologies for not getting to this sooner... 
> A rough a couple of weeks... 
> On 10/12/2016 02:01 AM, NeilBrown wrote:
>> 
>> 
>> To encourage uniformity across distributions, provide
>> systemd unit files.
>> 
>> If extra arguments are wanted for rpcbind, a drop-in should be used
>> to set the Environment= or read and EnvironmentFile=
>> 
>> As the "run" directory could be /run or /var/run we RequiresMountsFor
>> both of these.
> Talking with the systemd folks they strongly sugguest we just
> use /run (not /var/run) and drop the RequiresMountsFor.

I'm fine with that.  While maybe not everyone has /run, everyone running
systemd does.  I assume you'll just fix this rather than me
resubmitting?

Thanks,
NeilBrown


>
>> 
>> rpcbind.service pulls in rpcbind.socket so that the listening sockets
>> chosen there will always be used.
>> 
>> Signed-off-by: NeilBrown <neilb@suse.com>
>> ---
>>  .gitignore                 |  1 +
>>  Makefile.am                |  4 ++++
>>  configure.ac               |  7 ++++++-
>>  systemd/rpcbind.service.in | 17 +++++++++++++++++
>>  systemd/rpcbind.socket     | 19 +++++++++++++++++++
>>  5 files changed, 47 insertions(+), 1 deletion(-)
>>  create mode 100644 systemd/rpcbind.service.in
>>  create mode 100644 systemd/rpcbind.socket
>> 
>> hi,
>>  these are based on the unit files in use a SUSE, though I have made a
>>  few "improvements".
>>  If anyone has differences in their distros that you think we should
>>  have in mainline, I'd love to hear about it.
>> 
>> Thanks,
>> NeilBrown
>> 
>> 
>> diff --git a/.gitignore b/.gitignore
>> index 321dff64a57d..a8f1fed2acb6 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -27,3 +27,4 @@ rpcbind
>>  rpcinfo
>>  # cscope database files
>>  cscope.*
>> +systemd/rpcbind.service
>> diff --git a/Makefile.am b/Makefile.am
>> index 5ec8cd66b689..43c27100ceae 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -50,6 +50,10 @@ if SYSTEMD
>>  AM_CPPFLAGS += $(SYSTEMD_CFLAGS) -DSYSTEMD
>>  
>>  rpcbind_LDADD += $(SYSTEMD_LIBS)
>> +
>> +systemdsystemunit_DATA = \
>> +	systemd/rpcbind.service \
>> +	systemd/rpcbind.socket
>>  endif
>>  
>>  rpcinfo_SOURCES =       src/rpcinfo.c
>> diff --git a/configure.ac b/configure.ac
>> index af4b74b31c9a..0892d8246a12 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -61,4 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread])
>>  
>>  AC_CHECK_HEADERS([nss.h rpcsvc/mount.h])
>>  
>> -AC_OUTPUT([Makefile])
>> +# make bindir available for substitution in config file
>> +# 2 "evals" needed to expand variable names
>> +AC_SUBST([_bindir])
>> +AC_CONFIG_COMMANDS_PRE([eval eval _bindir=$bindir])
>> +
>> +AC_OUTPUT([Makefile systemd/rpcbind.service])
>> diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
>> new file mode 100644
>> index 000000000000..4706b5a77abf
>> --- /dev/null
>> +++ b/systemd/rpcbind.service.in
>> @@ -0,0 +1,17 @@
>> +[Unit]
>> +Description=RPC Bind
>> +Documentation=man:rpcbind(8)
>> +DefaultDependencies=no
>> +RequiresMountsFor=/var/run /run
>> +# Make sure we use the IP addresses listed for
>> +# rpcbind.socket, no matter how this unit is started.
>> +Wants=rpcbind.socket
>> +After=rpcbind.socket
>> +
>> +[Service]
>> +Type=notify
>> +# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
>> +ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
> This macro puts rpcbind in /usr/bin, but in the Red Hat
> distros rpcbind lives /usr/sbin. I could easily patch
> it to do the right thing... but is this a typo or does 
> rpcbind live in /usr/bin in other distros? 
>
> steved.
>
>
>> +
>> +[Install]
>> +WantedBy=multi-user.target
>> diff --git a/systemd/rpcbind.socket b/systemd/rpcbind.socket
>> new file mode 100644
>> index 000000000000..7204c97efa6f
>> --- /dev/null
>> +++ b/systemd/rpcbind.socket
>> @@ -0,0 +1,19 @@
>> +[Unit]
>> +Description=RPCbind Server Activation Socket
>> +DefaultDependencies=no
>> +RequiresMountsFor=/var/run /run
>> +Wants=rpcbind.target
>> +Before=rpcbind.target
>> +
>> +[Socket]
>> +ListenStream=/var/run/rpcbind.sock
>> +
>> +# RPC netconfig can't handle ipv6/ipv4 dual sockets
>> +BindIPv6Only=ipv6-only
>> +ListenStream=0.0.0.0:111
>> +ListenDatagram=0.0.0.0:111
>> +ListenStream=[::]:111
>> +ListenDatagram=[::]:111
>> +
>> +[Install]
>> +WantedBy=sockets.target
>>
NeilBrown Nov. 1, 2016, 8:04 p.m. UTC | #3
On Wed, Nov 02 2016, Steve Dickson wrote:

>> diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
>> new file mode 100644
>> index 000000000000..4706b5a77abf
>> --- /dev/null
>> +++ b/systemd/rpcbind.service.in
>> @@ -0,0 +1,17 @@
>> +[Unit]
>> +Description=RPC Bind
>> +Documentation=man:rpcbind(8)
>> +DefaultDependencies=no
>> +RequiresMountsFor=/var/run /run
>> +# Make sure we use the IP addresses listed for
>> +# rpcbind.socket, no matter how this unit is started.
>> +Wants=rpcbind.socket
>> +After=rpcbind.socket
>> +
>> +[Service]
>> +Type=notify
>> +# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
>> +ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
> This macro puts rpcbind in /usr/bin, but in the Red Hat
> distros rpcbind lives /usr/sbin. I could easily patch
> it to do the right thing... but is this a typo or does 
> rpcbind live in /usr/bin in other distros? 

oops, posted previous reply too quickly.

Hmm.. I have rpcbind in /sbin, but my rpm spec file
runs configure with "--bindir=/sbin"
The rpcbind makefile just installs rpcbind (and rpcbind) in bindir.
So presumably you run configure with --bindir=/usr/sbin ??

NeilBrown
Steve Dickson Nov. 2, 2016, 1:27 p.m. UTC | #4
On 11/01/2016 04:04 PM, NeilBrown wrote:
> On Wed, Nov 02 2016, Steve Dickson wrote:
> 
>>> diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
>>> new file mode 100644
>>> index 000000000000..4706b5a77abf
>>> --- /dev/null
>>> +++ b/systemd/rpcbind.service.in
>>> @@ -0,0 +1,17 @@
>>> +[Unit]
>>> +Description=RPC Bind
>>> +Documentation=man:rpcbind(8)
>>> +DefaultDependencies=no
>>> +RequiresMountsFor=/var/run /run
>>> +# Make sure we use the IP addresses listed for
>>> +# rpcbind.socket, no matter how this unit is started.
>>> +Wants=rpcbind.socket
>>> +After=rpcbind.socket
>>> +
>>> +[Service]
>>> +Type=notify
>>> +# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
>>> +ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
>> This macro puts rpcbind in /usr/bin, but in the Red Hat
>> distros rpcbind lives /usr/sbin. I could easily patch
>> it to do the right thing... but is this a typo or does 
>> rpcbind live in /usr/bin in other distros? 
> 
> oops, posted previous reply too quickly.
> 
> Hmm.. I have rpcbind in /sbin, but my rpm spec file
> runs configure with "--bindir=/sbin"
> The rpcbind makefile just installs rpcbind (and rpcbind) in bindir.
> So presumably you run configure with --bindir=/usr/sbin ??
I just took a look and we don't set that... Here is what we
set in Fedora

RPCBDIR=/tmp
%configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
    --enable-warmstarts \
    --with-statedir="$RPCBDIR" \
    --with-rpcuser="$RPCBUSR" \
    --with-nss-modules="files altfiles" \
    --enable-libwrap \
    --enable-debug

but in RHEL we set RPCBDIR to /run... 

steved.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thorsten Kukuk Nov. 2, 2016, 1:49 p.m. UTC | #5
On Wed, Nov 02, Steve Dickson wrote:

> I just took a look and we don't set that... Here is what we
> set in Fedora
> 
> RPCBDIR=/tmp
> %configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
>     --enable-warmstarts \
>     --with-statedir="$RPCBDIR" \
>     --with-rpcuser="$RPCBUSR" \
>     --with-nss-modules="files altfiles" \
>     --enable-libwrap \
>     --enable-debug

The rpcbind Makefile has:
bin_PROGRAMS = rpcbind rpcinfo

So per default, "make install" should install it into /usr/bin
and the patch from Niel with bin is correct.

  Thorsten
Steve Dickson Nov. 2, 2016, 6:06 p.m. UTC | #6
On 11/02/2016 09:49 AM, Thorsten Kukuk wrote:
> On Wed, Nov 02, Steve Dickson wrote:
> 
>> I just took a look and we don't set that... Here is what we
>> set in Fedora
>>
>> RPCBDIR=/tmp
>> %configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
>>     --enable-warmstarts \
>>     --with-statedir="$RPCBDIR" \
>>     --with-rpcuser="$RPCBUSR" \
>>     --with-nss-modules="files altfiles" \
>>     --enable-libwrap \
>>     --enable-debug
> 
> The rpcbind Makefile has:
> bin_PROGRAMS = rpcbind rpcinfo
> 
> So per default, "make install" should install it into /usr/bin
> and the patch from Niel with bin is correct.
You are correct... In  %install does the following

mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUILD_ROOT}/sbin
mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir}

Since rpcbind lives in /usr/sbin in the majority distro
I'm going to change the Makefile.am so "make install" 
will do the right thing... Any objections?

steved.
 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
NeilBrown Nov. 2, 2016, 9:16 p.m. UTC | #7
On Thu, Nov 03 2016, Steve Dickson wrote:

> On 11/02/2016 09:49 AM, Thorsten Kukuk wrote:
>> On Wed, Nov 02, Steve Dickson wrote:
>> 
>>> I just took a look and we don't set that... Here is what we
>>> set in Fedora
>>>
>>> RPCBDIR=/tmp
>>> %configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
>>>     --enable-warmstarts \
>>>     --with-statedir="$RPCBDIR" \
>>>     --with-rpcuser="$RPCBUSR" \
>>>     --with-nss-modules="files altfiles" \
>>>     --enable-libwrap \
>>>     --enable-debug
>> 
>> The rpcbind Makefile has:
>> bin_PROGRAMS = rpcbind rpcinfo
>> 
>> So per default, "make install" should install it into /usr/bin
>> and the patch from Niel with bin is correct.
> You are correct... In  %install does the following
>
> mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUILD_ROOT}/sbin
> mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir}
>
> Since rpcbind lives in /usr/sbin in the majority distro
> I'm going to change the Makefile.am so "make install" 
> will do the right thing... Any objections?

If you do it by changing the default for bindir, or by introducing an
sbindir that can be changed with configure, then no objections from me.
I'm not sure it really needs fixing, but I don't object to be being
fixed.

Thanks,
NeilBrown
Steve Dickson Nov. 2, 2016, 9:31 p.m. UTC | #8
On 11/02/2016 05:16 PM, NeilBrown wrote:
> On Thu, Nov 03 2016, Steve Dickson wrote:
>
>> On 11/02/2016 09:49 AM, Thorsten Kukuk wrote:
>>> On Wed, Nov 02, Steve Dickson wrote:
>>>
>>>> I just took a look and we don't set that... Here is what we
>>>> set in Fedora
>>>>
>>>> RPCBDIR=/tmp
>>>> %configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
>>>>     --enable-warmstarts \
>>>>     --with-statedir="$RPCBDIR" \
>>>>     --with-rpcuser="$RPCBUSR" \
>>>>     --with-nss-modules="files altfiles" \
>>>>     --enable-libwrap \
>>>>     --enable-debug
>>> The rpcbind Makefile has:
>>> bin_PROGRAMS = rpcbind rpcinfo
>>>
>>> So per default, "make install" should install it into /usr/bin
>>> and the patch from Niel with bin is correct.
>> You are correct... In  %install does the following
>>
>> mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUI
>>> Thanks,
>>> NeilBrown
>> LD_ROOT}/sbin
>> mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir}
>>
>> Since rpcbind lives in /usr/sbin in the majority distro
>> I'm going to change the Makefile.am so "make install" 
>> will do the right thing... Any objections?
> If you do it by changing the default for bindir, or by introducing an
> sbindir that can be changed with configure, then no objections from me.
> I'm not sure it really needs fixing, but I don't object to be being
> fixed.
>
Yes... basically
 
-bin_PROGRAMS = rpcbind rpcinfo
+sbin_PROGRAMS = rpcbind rpcinfo

and that seems to work... all this means the rpm spec file
will have to be tweaked when a new release is made.

All I'll for checking in these systemd file with the comments
from the systemd people and the bin=>sbin change.

How about a respin?

steved.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/.gitignore b/.gitignore
index 321dff64a57d..a8f1fed2acb6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,4 @@  rpcbind
 rpcinfo
 # cscope database files
 cscope.*
+systemd/rpcbind.service
diff --git a/Makefile.am b/Makefile.am
index 5ec8cd66b689..43c27100ceae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,6 +50,10 @@  if SYSTEMD
 AM_CPPFLAGS += $(SYSTEMD_CFLAGS) -DSYSTEMD
 
 rpcbind_LDADD += $(SYSTEMD_LIBS)
+
+systemdsystemunit_DATA = \
+	systemd/rpcbind.service \
+	systemd/rpcbind.socket
 endif
 
 rpcinfo_SOURCES =       src/rpcinfo.c
diff --git a/configure.ac b/configure.ac
index af4b74b31c9a..0892d8246a12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,4 +61,9 @@  AC_SEARCH_LIBS([pthread_create], [pthread])
 
 AC_CHECK_HEADERS([nss.h rpcsvc/mount.h])
 
-AC_OUTPUT([Makefile])
+# make bindir available for substitution in config file
+# 2 "evals" needed to expand variable names
+AC_SUBST([_bindir])
+AC_CONFIG_COMMANDS_PRE([eval eval _bindir=$bindir])
+
+AC_OUTPUT([Makefile systemd/rpcbind.service])
diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
new file mode 100644
index 000000000000..4706b5a77abf
--- /dev/null
+++ b/systemd/rpcbind.service.in
@@ -0,0 +1,17 @@ 
+[Unit]
+Description=RPC Bind
+Documentation=man:rpcbind(8)
+DefaultDependencies=no
+RequiresMountsFor=/var/run /run
+# Make sure we use the IP addresses listed for
+# rpcbind.socket, no matter how this unit is started.
+Wants=rpcbind.socket
+After=rpcbind.socket
+
+[Service]
+Type=notify
+# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
+ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/rpcbind.socket b/systemd/rpcbind.socket
new file mode 100644
index 000000000000..7204c97efa6f
--- /dev/null
+++ b/systemd/rpcbind.socket
@@ -0,0 +1,19 @@ 
+[Unit]
+Description=RPCbind Server Activation Socket
+DefaultDependencies=no
+RequiresMountsFor=/var/run /run
+Wants=rpcbind.target
+Before=rpcbind.target
+
+[Socket]
+ListenStream=/var/run/rpcbind.sock
+
+# RPC netconfig can't handle ipv6/ipv4 dual sockets
+BindIPv6Only=ipv6-only
+ListenStream=0.0.0.0:111
+ListenDatagram=0.0.0.0:111
+ListenStream=[::]:111
+ListenDatagram=[::]:111
+
+[Install]
+WantedBy=sockets.target