Sven Eden e4bdce0241 sci-misc/boinc: Update init script to fix bug 584386 and 603522
Gentoo-Bug: 584386

The boinc init script starts boinc_client in daemon mode, and relies on
boinccmd to send a quit signal to stop the service.

This leads to the following two problems:
1) It is not possible to generate a pid file, as the pid read from the
   started boinc_client is invalid after it forked to background.
2) The stop command immediately returns, but boinc_client can still be
   active for a long time, over a minute in fact, while it is stopping
   running projects and cleaning up its work data. This is especially
   problematic when boinc is stopped while shutting down the machine.

Gentoo-Bug: 603522

The init script for boinc calls "chown -R" on "${RUNTIMEDIR}".
This leads to the security issue, that the "boinc" user can create a
hardlink within ${RUNTIMEDIR} pointing to a file that he does not
own, and the next time the daemon is started, the init script (as
root) will give ownership of the *target* of the hardlink to the
boinc user.

This commit removes the usage of "chown -R" from start_pre(), and
adds a single call to "chown" to create_work_directory() if, and only
if the working directory has been newly created.

Other fixes and changes:

Another problem found is the function cuda_check(), which assumes the cuda
libraries to be installed in /opt/cuda/lib, leading to an invalid symlink
for libcudart.so on 64 bit machines where the library is installed in
/opt/cuda/lib64.

This commit changes the following behaviour, besides some long overdue
cleanup:
1) start() no longer uses the --daemon option of the boinc_client, but
   the --background option of the start-stop-daemon command. Further it
   creates a pid file in the path set by the new config variable
   BOINC_PIDFILE, that has been added to boinc.conf.
2) stop() no longer uses boinccmd to send a quit signal, but uses the
   --stop and --pidfile options of the start-stop-daemon command. The
   waiting time should be large enough to successfully await the end of
   the exiting task of the boinc_client program.
3) cuda_check() now checks the validity of the libcudart.so symlink and
   removes it if it is invalid. Further it looks for a present
   libcudart.so library in /opt/cuda/lib* and picks the newest found to
   create a new symlink if none is present.
4) The suspend() and resume() functions have been updated to use the
   start-stop-daemon command, so both the user:group and a possibly
   required password are now used to circumvent authentication errors.

Package-Manager: portage-2.3.3
Closes: https://github.com/gentoo/gentoo/pull/3056
2017-01-04 15:41:54 +02:00
2017-01-04 14:37:55 +01:00
2017-01-04 10:50:26 +01:00
2017-01-03 23:54:32 +01:00
2016-12-28 22:37:36 +00:00
2017-01-04 08:02:08 +01:00
2016-12-26 01:44:28 +03:00
2017-01-04 02:23:13 +01:00
2016-11-29 09:33:22 -05:00
2016-12-13 14:45:05 +01:00
2017-01-02 22:09:06 +00:00
2017-01-04 06:02:05 +00:00
2017-01-03 08:28:34 -07:00
2017-01-04 14:34:32 +02:00
S
Description
No description provided
9.8 GiB
Languages
Shell 98%
Roff 1.4%
Emacs Lisp 0.2%
C 0.1%