Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 194679 - www-apps/trac-0.10.4: tracd init.d don't start the daemon w/ --chuid used
Summary: www-apps/trac-0.10.4: tracd init.d don't start the daemon w/ --chuid used
Status: VERIFIED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Julien Allanos (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-04 06:47 UTC by Andrea Bernardi
Modified: 2007-10-23 11:02 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Bernardi 2007-10-04 06:47:02 UTC
I have installed tracd on a server and with the default
/etc/init.d/tracd script don't start. The command line launched by the
start() function is the following:

start-stop-daemon --start --quiet \
               --chuid ${TRACD_USER:-tracd}:${TRACD_GROUP:-tracd} \
               --exec /usr/bin/tracd -- -d -p ${TRACD_PORT:-8000} \
               ${TRACD_OPTS:---env-parent-dir /var/lib/trac/}

I've found that if i remove the --chuid option tracd start without
problem. I think the problem is for some configuration of the server,
but I tried also in my local machine and I've obtained the same
problem.

The nasty problem is that i want to run tracd with user and group
apache instead of root and also if i've searched in the net i don't
have found a functional method.

Reproducible: Always
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-10-04 07:35:43 UTC
Does it work if you set TRACD_USER to tracd (or just unset this in /etc/conf.d/trac)? Also, emerge --info please.
Comment 2 Andrea Bernardi 2007-10-04 07:55:48 UTC
No, don't work if I set user to TRACD_USER to tracd and if I unset TRACD_USER and TRACD_GROUP. Start only without --chuid option.

I list the 'emerge --info' of my local machine where also tracd don't start if I want to start with a different user (like tracd).

emerge --info
Portage 2.1.3.7 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.5-r4, 2.6.20.1 i686)
=================================================================
System uname: 2.6.20.1 i686 Genuine Intel(R) CPU T2050 @ 1.60GHz
Gentoo Base System release 1.12.10
Timestamp of tree: Wed, 03 Oct 2007 18:20:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.31-r3
dev-lang/python:     2.4.4-r4, 2.5.1-r2
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/baselayout: 1.12.10-r4
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=prescott -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/"
LANG="it_IT@euro"
LC_ALL="it_IT@euro"
LINGUAS="it"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi alsa amr apm arts bash-completion bitmap-fonts bzip2 cairo cdr cli cracklib crypt cscope cups dbus dio divx djvu dmi dri dvd dvdr dvdread eds emacs emboss encode esd evo fam ffmpeg firefox flac fortran gdbm gif glitz gmedia gnome gpm gstreamer gtk hal iconv ipv6 isdnlog java jpeg kde kerberos ldap libcaca mad midi mikmod mmx mozdevelop mp3 mpeg mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp oss pam pcre pdf perl png pppd python qt3 qt3support qt4 quicktime readline real realmedia reflection ruby sdl session shout spell spl sqlite sse ssl svg tcpd threads tiff truetype truetype-fonts type1-fonts unicode vorbis win32codecs wmp wxwindows x86 xinerama xml xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" USERLAND="GNU" VIDEO_CARDS="i810 vga vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-10-04 08:00:42 UTC
Reopen.
Comment 4 Roy Marples (RETIRED) gentoo-dev 2007-10-04 08:47:00 UTC
Attach output of following please

getent passwd tracd
getent group tracd
stat /var/lib/trac
stat $(getent passwd trac | cut -d: -f 6)
Comment 5 Andrea Bernardi 2007-10-04 09:13:57 UTC
Here the output of the command:

melchizedec ~ # getent passwd tracd
tracd:x:106:1012:added by portage for trac:/dev/null:/sbin/nologin


melchizedec ~ # getent group tracd
tracd:x:1012:

melchizedec ~ # stat /var/lib/trac/
  File: `/var/lib/trac/'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 805h/2053d      Inode: 1657873     Links: 10
Access: (0755/drwxr-xr-x)  Uid: (  106/   tracd)   Gid: ( 1012/   tracd)
Access: 2007-10-03 21:30:08.000000000 +0200
Modify: 2007-10-04 10:57:41.000000000 +0200
Change: 2007-10-04 10:57:58.000000000 +0200

melchizedec ~ # stat $(getent passwd tracd | cut -d: -f 6)
  File: `/dev/null'
  Size: 0               Blocks: 0          IO Block: 4096   character special file
Device: dh/13d  Inode: 1826        Links: 1     Device type: 1,3
Access: (0666/crw-rw-rw-)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2007-10-04 10:31:56.300863469 +0200
Modify: 2007-10-04 10:31:56.300863469 +0200
Change: 2007-10-04 10:31:57.171730613 +0200

Comment 6 Roy Marples (RETIRED) gentoo-dev 2007-10-04 09:23:09 UTC
tracd user needs a valid home dir I guess. Try setting it to /var/lib/trac

This is probably not an issue with start-stop-daemon
Comment 7 Julien Allanos (RETIRED) gentoo-dev 2007-10-04 09:42:33 UTC
Here on my box, tracd has /dev/null as home too, and the daemon starts fine.
Comment 8 Roy Marples (RETIRED) gentoo-dev 2007-10-04 09:55:15 UTC
OK, the issue could be that apache needs write access to /var/lib/trac then, which it clearly doesn't
Comment 9 Andrea Bernardi 2007-10-04 09:59:01 UTC
No, also if I set the home /var/lib/trac but don't start with --chuid. Maybe is
caused because tracd is launched via python interpreter. Without --chuid this
is result of ps aux:

root     24049  0.0  0.4   8380  4920 ?        S    11:36   0:00
/usr/bin/python /usr/bin/tracd -d -p 80 --env-parent-dir /var/lib/trac/

I also set tracd:tracd on permission on tracd but start always with user root.

Now I do the proof on my box without apache, and search only to launch tracd with a different user.
Comment 10 Roy Marples (RETIRED) gentoo-dev 2007-10-04 10:13:23 UTC
Try this

su - apache
/usr/bin/python /usr/bin/tracd -d -p 80 --env-parent-dir /var/lib/trac/

Then you should get a nice error message
Comment 11 Andrea Bernardi 2007-10-04 10:32:28 UTC
Hmmm.. maybe this is a little problem:

melchizedec ~ # su - apache
This account is currently not available.

and also

melchizedec sbin # su - tracd
This account is currently not available.
Comment 12 Julien Allanos (RETIRED) gentoo-dev 2007-10-04 10:34:49 UTC
This is because these users have /sbin/nologin as shell.
Comment 13 Andrea Bernardi 2007-10-04 10:41:35 UTC
Is this a problem? 
Now I upgraded to the last baselayout-1.12.10-r5 to see if is a bug of start-stop-daemon but the problem persists. Also from command line how can I start tracd with a user unlike root?
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2007-10-04 11:33:49 UTC
(In reply to comment #12)
> This is because these users have /sbin/nologin as shell.

No, it's not a problem, but you need a valid shell *temporarily* to be able to su - to that UID. I still can't reproduce your issue.

Comment 15 Andrea Bernardi 2007-10-04 13:53:31 UTC
Ok, if in your box the daemon starts fine maybe is my erroneuos configuration in some script that I haven't taken in consideration.

Thank you very much for the help. I think to close the bug.
Comment 16 Julien Allanos (RETIRED) gentoo-dev 2007-10-22 06:45:28 UTC
So what do we do? CANTFIX?
Comment 17 Roy Marples (RETIRED) gentoo-dev 2007-10-22 07:13:49 UTC
WorksForMe

And reporter thinks it's a config issue on his side.
Comment 18 Andrea Bernardi 2007-10-23 11:01:33 UTC
I didn't try other things, but if in your box the daemon starts fine is surely a my configuration problem. I close the bug.

Thanks you very much for the help.
Comment 19 Andrea Bernardi 2007-10-23 11:02:08 UTC
I didn't try other things, but if in your box the daemon starts fine is surely a my configuration problem. I close the bug.

Thanks you very much for the help.