<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nfs-utils.git/utils/statd/start-statd, branch fixrootccache</title>
<subtitle>NFS utils related patches</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/'/>
<entry>
<title>start-statd: script using incompatible file descriptor</title>
<updated>2016-12-20T18:26:03+00:00</updated>
<author>
<name>Daniel Pocock</name>
<email>daniel@pocock.pro</email>
</author>
<published>2016-12-20T18:26:03+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=30a82104e0360568c56eff08000f76360eb5ffb2'/>
<id>30a82104e0360568c56eff08000f76360eb5ffb2</id>
<content type='text'>
POSIX.1-2008 only specifies that file descriptor numbers
from 0 to 9, inclusive, are supported.  The number 200 works
in the bash shell, but not in dash.  This patch changes the file
descriptor number from 200 to 9.  Reported in Debian bug #848277

Signed-off-by: Daniel Pocock &lt;daniel@pocock.pro&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
POSIX.1-2008 only specifies that file descriptor numbers
from 0 to 9, inclusive, are supported.  The number 200 works
in the bash shell, but not in dash.  This patch changes the file
descriptor number from 200 to 9.  Reported in Debian bug #848277

Signed-off-by: Daniel Pocock &lt;daniel@pocock.pro&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>start-statd: Use flock to serialize the running of this script</title>
<updated>2016-06-21T16:07:50+00:00</updated>
<author>
<name>Steve Dickson</name>
<email>steved@redhat.com</email>
</author>
<published>2016-06-21T16:06:06+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=8fef90084f3d19e90ba1bb22b8cd1d58ddaf6ef3'/>
<id>8fef90084f3d19e90ba1bb22b8cd1d58ddaf6ef3</id>
<content type='text'>
To once and for all stop multiple rpc.statd from
being started (mostly in HA environments), use
flock to serialize the running of the script

Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To once and for all stop multiple rpc.statd from
being started (mostly in HA environments), use
flock to serialize the running of the script

Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>start-statd: don't run multiple rpc.statds on the one host.</title>
<updated>2016-01-16T17:30:13+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.com</email>
</author>
<published>2016-01-16T17:09:50+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=d92017cccaffb02f7f4e00d0fdd6ef5042bb6341'/>
<id>d92017cccaffb02f7f4e00d0fdd6ef5042bb6341</id>
<content type='text'>
If rpc.statd is running but slow to respond, mount.nfs will
run "start-statd" which might start a new statd.  This is not a good
ideas as can result in lots of rpc.statds.

So inf start-statd check the pid file and if rpc.statd seems to be
running, exit with success.

(also "cd /" before running rpc.statd, just in case).

Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If rpc.statd is running but slow to respond, mount.nfs will
run "start-statd" which might start a new statd.  This is not a good
ideas as can result in lots of rpc.statds.

So inf start-statd check the pid file and if rpc.statd seems to be
running, exit with success.

(also "cd /" before running rpc.statd, just in case).

Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>start-statd: Use the canonical to check if systemd is running.</title>
<updated>2015-01-15T10:46:11+00:00</updated>
<author>
<name>Steve Dickson</name>
<email>steved@redhat.com</email>
</author>
<published>2015-01-14T15:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=fd88e113714a099e01d1fb34ade6b858904d664d'/>
<id>fd88e113714a099e01d1fb34ade6b858904d664d</id>
<content type='text'>
Use the approved way, define in
   http://www.freedesktop.org/software/systemd/man/sd_booted.html

to check if systemd is installed and running

Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the approved way, define in
   http://www.freedesktop.org/software/systemd/man/sd_booted.html

to check if systemd is installed and running

Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>start-statd: clean up output when systemd is not installed</title>
<updated>2014-08-19T14:05:05+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2014-08-19T14:05:05+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=00bb6d244cbf4a09fdbd3fce2a3d57986087d928'/>
<id>00bb6d244cbf4a09fdbd3fce2a3d57986087d928</id>
<content type='text'>
If you don't have systemd, then this script dumps:
/usr/sbin/start-statd: line 8: systemctl: command not found

This isn't terribly useful since we ultimately fall back to running
the daemon ourselves, so probe for systemd's existence before we try
to use it.

Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If you don't have systemd, then this script dumps:
/usr/sbin/start-statd: line 8: systemctl: command not found

This isn't terribly useful since we ultimately fall back to running
the daemon ourselves, so probe for systemd's existence before we try
to use it.

Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>start-statd: rpc.statd's systemd unit changed names.</title>
<updated>2014-05-01T14:35:12+00:00</updated>
<author>
<name>Steve Dickson</name>
<email>steved@redhat.com</email>
</author>
<published>2014-05-01T14:35:12+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=9a36e0227c4dd8c3ebd1fbb313737c9b95fbd7e1'/>
<id>9a36e0227c4dd8c3ebd1fbb313737c9b95fbd7e1</id>
<content type='text'>
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>systemd: add PATH for finding systemctl</title>
<updated>2014-04-25T14:28:47+00:00</updated>
<author>
<name>Kinglong Mee</name>
<email>kinglongmee@gmail.com</email>
</author>
<published>2014-04-25T14:28:47+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=edbbbe099bf4d4902f29d087239d6d159ac2187d'/>
<id>edbbbe099bf4d4902f29d087239d6d159ac2187d</id>
<content type='text'>
The 1.3.0 release adds a call to systemctl fails for it's in /usr/bin.

[root@localhost nfs-utils]# start-statd
/usr/sbin/start-statd: line 9: systemctl: command not found
Statd service already running!

Reported-by: Allan Duncan &lt;amd1234@fastmail.com.au&gt;
Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The 1.3.0 release adds a call to systemctl fails for it's in /usr/bin.

[root@localhost nfs-utils]# start-statd
/usr/sbin/start-statd: line 9: systemctl: command not found
Statd service already running!

Reported-by: Allan Duncan &lt;amd1234@fastmail.com.au&gt;
Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>start-statd: converted to use systemd</title>
<updated>2014-03-24T20:30:04+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-01-31T16:05:56+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=013ffe58343d922505e561af57bdb1f93078361a'/>
<id>013ffe58343d922505e561af57bdb1f93078361a</id>
<content type='text'>
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>start-statd: Use bash as -p is no POSIX</title>
<updated>2011-08-29T16:04:25+00:00</updated>
<author>
<name>Luk Claes</name>
<email>luk@debian.org</email>
</author>
<published>2011-08-29T16:04:25+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=708f2d63ee2641f72d3a87ce65f12e83e5ad60be'/>
<id>708f2d63ee2641f72d3a87ce65f12e83e5ad60be</id>
<content type='text'>
sh -p is not guaranteed to be provided by POSIX shells. dash for
instance does not provide this, so use bash explicitly.

Signed-off-by: Luk Claes &lt;luk@debian.org&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sh -p is not guaranteed to be provided by POSIX shells. dash for
instance does not provide this, so use bash explicitly.

Signed-off-by: Luk Claes &lt;luk@debian.org&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Ensure statd gets started if required when non-root</title>
<updated>2008-11-26T17:01:06+00:00</updated>
<author>
<name>Neil Brown</name>
<email>neilb@suse.de</email>
</author>
<published>2008-11-26T17:01:06+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/simo/public_git/nfs-utils.git/commit/?id=33bbeabb40d11a59266e0702adaa6a2e0acb6382'/>
<id>33bbeabb40d11a59266e0702adaa6a2e0acb6382</id>
<content type='text'>
user mounts an NFS filesystem.

The first time an NFS filesystem is mounted, we start statd from
/sbin/mount.nfs.  If this first time is a non-root user doing the
 mount, (thanks to e.g.  the 'users' option in /etc/fstab)
then we need to be sure that the 'setuid' status from mount.nfs
is inherited through to rpc.statd so that it runs as root.

There are two places where we loose our setuid status due to the shell
(/bin/sh) discarding.

1/ mount.nfs uses "system" to run /usr/sbin/start-statd.  This runs a
   shell which is likely to drop privileges.  So change that code to use
  'fork' and 'execl' explicitly.
2/ start-statd is a shell script.  To convince the shell to allow the
  program to run in privileged mode, we need to add a "-p" flag.

We could just call setuid(getuid()) at some appropriate time, and it
might be worth doing that as well, however I think that getting
rid of 'system()' is a good idea and once that is done, the
adding of '-p' is trivial and sufficient.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
user mounts an NFS filesystem.

The first time an NFS filesystem is mounted, we start statd from
/sbin/mount.nfs.  If this first time is a non-root user doing the
 mount, (thanks to e.g.  the 'users' option in /etc/fstab)
then we need to be sure that the 'setuid' status from mount.nfs
is inherited through to rpc.statd so that it runs as root.

There are two places where we loose our setuid status due to the shell
(/bin/sh) discarding.

1/ mount.nfs uses "system" to run /usr/sbin/start-statd.  This runs a
   shell which is likely to drop privileges.  So change that code to use
  'fork' and 'execl' explicitly.
2/ start-statd is a shell script.  To convince the shell to allow the
  program to run in privileged mode, we need to add a "-p" flag.

We could just call setuid(getuid()) at some appropriate time, and it
might be worth doing that as well, however I think that getting
rid of 'system()' is a good idea and once that is done, the
adding of '-p' is trivial and sufficient.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Steve Dickson &lt;steved@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
