Recently this init script has been added to net-irc/quassel The problem seems to be that it doesn't work correctly with baselayout-1. Quasselcore is always launched as root, even if QUASSEL_USER is defined in /etc/conf.d/quasselcore Changing "--user" with "--chuid" makes quasselcore launch as user, but it looks for the configuration in the wrong place: /root/ instead of /home/user/ Here's the output I get by removing "--background" and with "--chuid": # $ /etc/init.d/quasselcore start # * Caching service dependencies ... [ ok ] # * Starting Quassel Core ... # Unable to create Quassel data directory: /root/.quassel # 2008-08-27 20:43:49 Warning: SslServer: SSL Certificate is either missing or has a wrong format! # Quassel Core will still work, but cannot provide SSL for client connections. # Please see http://quassel-irc.org/faq/cert to learn how to enable SSL support. # 2008-08-27 20:43:49 Warning: Core is currently not configured! Please connect with a Quassel Client for basic setup. # 2008-08-27 20:43:49 Info: Listening for GUI clients on port 4242 using protocol version 5 As you can see it looks for /root/.quassel Instead it should look for /home/user/.quassel $ eix baselayout [I] sys-apps/baselayout Available versions: [P]1.11.15-r3 1.12.11.1 ~1.12.12 ~2.0.0 {bootstrap build static unicode} Installed versions: 1.12.11.1(08:23:46 21/06/2008)(unicode -bootstrap -build -static) Reproducible: Always
(In reply to comment #0) > Changing "--user" with "--chuid" makes quasselcore launch as user, but it > looks for the configuration in the wrong place: /root/ instead of /home/user/ Something came to my mind regarding this problem. Try to use --chuid and --user in combination: --user ${QUASSEL_USER} --chuid ${QUASSEL_USER} Maybe chuid really just changes to the specified ID but not the users environment. But I don't think this is the problem. After digging into this a bit deeper. My guess is this is a bug in baselayout which does not change $HOME when using --chuid. There was also an ancient bug in Debian [1,2]. It states it was fixed in version 1.13.15. I don't know how the version of Debian is related to Gentoos version. Maybe Roy Marples (uberlord) can help us here. [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=267784 [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295169
I tried your suggestion, but I get the same error as before. Unable to create Quassel data directory: /root/.quassel
(In reply to comment #1) > But I don't think this is the problem. After digging into this a bit deeper. My > guess is this is a bug in baselayout which does not change $HOME when using > --chuid. There was also an ancient bug in Debian [1,2]. It states it was fixed > in version 1.13.15. I don't know how the version of Debian is related to > Gentoos version. You are correct - baselayout-1 does not set $HOME. OpenRC does this correctly.
(In reply to comment #3) > You are correct - baselayout-1 does not set $HOME. > OpenRC does this correctly. Thanks for your reply. Is there any way to work around this in old start-stop-daemon? Many users still running stable Gentoo and thus using the old baselayout. Or is it possible to do this in the init script by just using something like this: HOME=/home/${QUASSEL_USER}
> Or is it possible to do this in the init script by just using something like > this: > > HOME=/home/${QUASSEL_USER} > This works! :) Thanks a lot Daniel. Also "--chuid" is enough, "--user" isn't needed.
(In reply to comment #5) > This works! :) > Thanks a lot Daniel. > Also "--chuid" is enough, "--user" isn't needed. Fine! Can you just attach the changed script here. I will take a look at it later and make it work with old baselayout and new openrc.
Created attachment 163987 [details] fixed script I don't remember if the --background option was in the stop part or not since I changed the script several times, please check it :)
reopened since this isn't fixed in portage yet :)
Created attachment 164019 [details, diff] quasselcore.init.diff Attached init script should work with baselayout-1 and baselayout-2/openrc!
Created attachment 164020 [details, diff] quassel-0.3.0.diff Changed quassel-0.3.0.ebuild removed complex checking for qt, qt-sql and aligned it to quassel-9999-r1.ebuild
Created attachment 164022 [details, diff] quassel-9999-r1.diff Changed quassel-9999-r1.ebuild removed complex checking for qt, qt-sql and aligned it to quassel-0.3.0.ebuild
(In reply to comment #9) > Created an attachment (id=164019) [edit] > quasselcore.init.diff > Attached init script should work with baselayout-1 and baselayout-2/openrc! start-stop-daemon from baselayout-1 also supports setting of environment variables: -e|--env env-name Set an environment variable whose name and value is env-name before starting executable. Example: -e HOME="/home/user" exports an environment variable whose name is HOME with value "/home/user". So instead of setting HOME=/home/${QUASSEL_USER} separately we can do this in the start-stop-daemon command directly like adding the following to the start command: --env HOME="/home/${QUASSEL_USER}"
Created attachment 164069 [details, diff] quasselcore.init.diff updated script with --env
the last patch works as expected with baselayout-1
Added fixed initscript with revbumps to portage, keep up the good work guys ;)