Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 488656 - =net-p2p/deluge-1.3.6 - Init script doesn't start deluge; the deluge process name is not "deluged", removing "--name deluged" argument fixes it
Summary: =net-p2p/deluge-1.3.6 - Init script doesn't start deluge; the deluge process ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Paolo Pedroni
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-20 01:35 UTC by Craig Andrews
Modified: 2016-02-22 11:39 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 Craig Andrews gentoo-dev 2013-10-20 01:35:12 UTC
The net-p2p/deluge-1.3.6 init script doesn't work.

The problem is that "--name deluged" is given as an argument to start-stop-daemon, but the deluge process name is not "deluged". Since start-stop-daemon manages the pid file, there is really no reason to do name based process management; simply removing the "--name deluged" argument fixes the problem making the init script work correctly.

Reproducible: Always

Steps to Reproduce:
1. /etc/init.d/deluged start
Actual Results:  
"ps aux | grep deluged" shows that deluge isn't running.

Expected Results:  
deluged should be running.

# emerge --info
!!! Repository 'x-portage' is missing masters attribute in '/usr/local/portage/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
!!! Repository 'openrc' is missing masters attribute in '/var/lib/layman/openrc/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
!!! Repository 'webapp-experimental' is missing masters attribute in '/var/lib/layman/webapps-experimental/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
Portage 2.2.7 (default/linux/amd64/13.0, gcc-4.8.1, glibc-2.17, 3.11.4-gentoo x86_64)
=================================================================
System uname: Linux-3.11.4-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-gentoo-2.2
KiB Mem:     3980100 total,    519740 free
KiB Swap:    3981288 total,   3883864 free
Timestamp of tree: Sat, 19 Oct 2013 00:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r3, 3.3.2-r2
dev-util/ccache:          3.1.9-r2
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.2
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.8.1-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo openrc webapp-experimental sunrise mv sabayon x-portage
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA Intel-SDP"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.1/conf /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer -flto"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4.5"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -flto"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/openrc /var/lib/layman/webapps-experimental /var/lib/layman/sunrise /var/lib/layman/mv /var/lib/layman/sabayon /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac aacs acl acpi aiglx alsa amd64 amr amrnb amrwb animation apache2 apng artworkextra asf aspnet2 asyncns authdaemond avahi avi bash-completion bcmath berkdb bitmap-fonts bluetooth bluray bmp bonjour bzip2 cairo caps ccache cdda cddb cdparanoia cdr chm clang cli consolekit cracklib crypt cryptsetup css cups curl cxx daap dbus device-mapper dga dhclient dirac divx4linux dlloader dovecot-sasl dpms dri dts dv dvb dvd dvdr dvdread egl enca encode exif faac fam fame fat fbcondecor fbsplash ffmpeg fftw firefox flac fontconfig foomaticdb fortran freetype ftp fuse gaim gd gdbm geoip gif gimpprint glamor gles glib glibc-omitfp glitz glut gphoto2 gsm gstreamer gstreamer10 gtk gtk2 gudev hardenedphp hbci howl howl-compat https hwdb iconv icu idn imagemagick imap imlib innodb ipv6 java java5 jbig joystick jpeg jpeg2k junit kdehiddenvisibility kvm lapack lcms libfame libkms libnotify libsamplerate libusb lirc live lm_sensors lzma lzo mad maildir mdnsresponder-compat mjpeg mmap mms mmx mmxext mng modules motif mozilla mozsvg mp3 mpeg mpeg2 mplayer mudflap multilib musepack mysql mythtv ncurses nemesi network networkmanager nls nptl nptlonly ntfs offensive ofx ogg oggvorbis openal openexr opengl openmp openvg opus pam pango pcre pdf pdflib perl phonon pic pie png pnp policykit ppd ppds pulseaudio python qt qt3 qt3support qt4 quicktime quvi rar readline resolvconf rtc rtmp samba schroedinger screensaver sctp sdl session sftp sharedmem shout smp sna sni snmp sox speex spell sqlite sse sse2 sse3 ssh ssl ssse3 suspend2 svg tcpd theora threads tiff tls transcode truetype truetype-fonts type-fonts udev udisks unicode unzip upnp ups usb uxa v4l2 vaapi vcd vdpau videos vorbis vpx wayland webdav webkit webp webservices wifi win32codecs wmf wv x264 xa xanim xattr xcb xcomposite xinerama xml xml2 xpm xprint xrandr xv xvid xvmc zeroconf zip zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dconf deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest proxy proxy_ajp proxy_connect proxy_http reqtimeout cgi" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="nss" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" LIRC_DEVICES="userspace" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel ilo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Craig Andrews gentoo-dev 2013-10-20 03:14:12 UTC
I was too quick with my original solution; it doesn't work either. The reason is that /usr/bin/deluged forks off another script, which has it's own pid, so when start-stop-daemon creates the pid file it's for /usr/bin/deluged (which immediately terminates) and not what we really want. This is also why the currently in portage init script doesn't work.

This is what I'm using now for the "start()" block, and it seems to be working well:

start() {
        checkconfig || return $?
        if [ "${DELUGED_HOME}" = "" ] ; then
                DELUGED_USER_HOME=$(getent passwd "${DELUGED_USER%:*}" | cut -d ':' -f 6)
        else
                DELUGED_USER_HOME=${DELUGED_HOME}
        fi
        ebegin "Starting Deluged"
        touch /var/run/deluged.pid
        chown p2p /var/run/deluged.pid
        start-stop-daemon --start --user "${DELUGED_USER%:*}" -e HOME="${DELUGED_USER_HOME}" \
        --exec /usr/bin/deluged -- --pidfile /var/run/deluged.pid "${DELUGED_OPTS}"
        chown root /var/run/deluged.pid
        eend $?


        if [ "${DELUGEUI_START}" = "true" ] ; then
                ebegin "Starting Deluge"
                start-stop-daemon --start --background --pidfile \
                /var/run/deluge.pid  --make-pidfile \
                --exec /usr/bin/deluge --user "${DELUGED_USER%:*}" \
                -e HOME="${DELUGED_USER_HOME}" -- ${DELUGEUI_OPTS}
                eend $?
        fi
}

This approach has deluge create its own pid file, and start-stop-daemon uses it.
Comment 2 Paolo Pedroni 2016-02-15 15:55:59 UTC
Is this still a problem? I tried today and it worked right fine with the original init file.
Comment 3 Paolo Pedroni 2016-02-22 11:39:40 UTC
Please reopen if you still have problems.