Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 574260 - sci-misc/boinc-7.4.42-r1: init script fails
Summary: sci-misc/boinc-7.4.42-r1: init script fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Eden
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-09 13:56 UTC by Yutao Yuan
Modified: 2016-05-28 10:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
boinc-init.patch (boinc-init.patch,722 bytes, patch)
2016-03-29 15:34 UTC, Russell Knighton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yutao Yuan 2016-02-09 13:56:47 UTC
I get this message when trying to start boinc:

$ sudo /etc/init.d/boinc start
 * Starting boinc ...
This account is currently not available.                                                                                                         [ !! ]
 * ERROR: boinc failed to start

I believe this is caused by the lack of $SHELL when running the script, making su use the login shell (/sbin/nologin). Passing -s /bin/sh to su should fix this problem.
Comment 1 Fabien MAUREL 2016-02-21 08:01:36 UTC
Hello 

Same here.

 * Starting boinc ...
This account is currently not available.                                                                                                                                                                                               [ !! ]
 * ERROR: boinc failed to start
Comment 2 David Seifert gentoo-dev 2016-03-25 17:36:34 UTC
Sven, can you please have a look whether this is fixed with your latest ebuild?
Comment 3 Russell Knighton 2016-03-29 15:28:04 UTC
For me, the init script now starts correctly (with the "-s /bin/sh " addition), but it doesn't stop; it instead gives the same error of "The account is currently not available".

Adding the same fix to the su in the stop() function fixest that problem, but this fix needs to also be applied to the "su ..." line in attach() function?

I'll attach a patch for the additional changes required.
Comment 4 Russell Knighton 2016-03-29 15:34:32 UTC
Created attachment 429240 [details, diff]
boinc-init.patch

Patch of additional changes needed to boinc init file.
Comment 5 Sven Eden 2016-04-04 07:57:16 UTC
I still need to try to reproduce this.

Currently it is like this on my system, and always was:

--------
~ $ sudo /etc/init.d/boinc start
Passwort: 
 * Starting boinc ...              [ ok ]
--------

But I am on it.
Comment 6 Yutao Yuan 2016-04-06 00:57:49 UTC
This may be related to openrc version. I think this is only happening for openrc-0.20, which no longer pass $SHELL to init scripts.
Comment 7 Sven Eden 2016-04-06 09:03:21 UTC
(In reply to Yutao Yuan from comment #6)
> This may be related to openrc version. I think this is only happening for
> openrc-0.20, which no longer pass $SHELL to init scripts.

Thank you for the hint, I am on stable openrc.

I'll upgrade openrc and see whether I can replicate the problem.
Comment 8 Sven Eden 2016-04-12 12:11:27 UTC
Sorry for the long delay!

I have eventually reproduced the problem and Russels suggestions fix it.

I have created a pull request: https://github.com/gentoo/gentoo/pull/1244
Comment 9 Sven Eden 2016-04-13 12:15:19 UTC
(In reply to Sven Eden from comment #8)
> Sorry for the long delay!
> 
> I have eventually reproduced the problem and Russels suggestions fix it.
> 
> I have created a pull request: https://github.com/gentoo/gentoo/pull/1244

I have taken a stept back from the "su -s /bin/sh" fix and instead migrated the init script to use start-stop-daemon instead. My pull request has been updated accordingly.
Comment 10 Patrice Clement gentoo-dev 2016-04-23 07:55:39 UTC
William when you get round to it, could you please sign off on the PR please? Thanks!
Comment 11 Patrice Clement gentoo-dev 2016-04-26 07:23:31 UTC
commit 6fbb2367cc20a9b34acde2f1df699900f310a9cf (HEAD -> master)
Author:     Sven Eden <yamakuzure@gmx.net>
AuthorDate: Wed Apr 13 14:09:53 2016 +0200
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: Tue Apr 26 07:07:58 2016 +0000

sci-misc/boinc: Migrated boinc.init to use start-stop-daemon

The boinc init script can no longer start, attach or stop the boinc
manager if openrc-0.20 and newer is used, because openrc no longer
passes $SHELL to init scripts.

To solve the issue the init script has been migrated to use
start-stop-daemon instead of using 'su' directly.

This change should have no impact for users of previous openrc
versions.

Gentoo-Bug: https://bugs.gentoo.org/574260
Package-Manager: portage-2.2.28
Closes: https://github.com/gentoo/gentoo/pull/1244

Signed-off-by: Patrice Clement <monsieurp@gentoo.org>

sci-misc/boinc/files/boinc.init | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)


William, since you want to keep track of the changes, I'm leaving this bug open. Feel free to close it.
Comment 12 Sven Eden 2016-04-29 09:41:28 UTC
For the current clean-up of the boinc ebuilds, I have further enhanced the script.

Besides some suggestions by Jan Chren, the password handling is now safer. From boinc 7.4.x on the boinccmd command no longer needs the password to be submitted via command line. It is automatically read from the config file.

The fix is included in this pull request:

https://github.com/gentoo/gentoo/pull/1374
Comment 13 Sven Eden 2016-05-06 06:20:45 UTC
The fixed init script is merged into the portage tree.
Comment 14 peter@prh.myzen.co.uk 2016-05-24 14:03:06 UTC
(In reply to Sven Eden from comment #12)
> For the current clean-up of the boinc ebuilds, I have further enhanced the
> script.
> 
> Besides some suggestions by Jan Chren, the password handling is now safer.
> From boinc 7.4.x on the boinccmd command no longer needs the password to be
> submitted via command line. It is automatically read from the config file.


Starting boinc is now indeed much better - thanks Sven.

Unfortunately, the same can't be said of stopping it:

# /etc/init.d/boinc stop
 * Caching service dependencies                                       [ ok ]
 * Stopping boinc ...
 * start-stop-daemon: boinccmd                                        [ !! ]
 * ERROR: boinc failed to stop
#

Boinc does end up stopped, but before I can start it again I have to zap it.

Please re-open the bug. Sorry to be a nuisance :-)
Comment 15 peter@prh.myzen.co.uk 2016-05-28 10:18:57 UTC
Never mind. I've opened bug 584386.