Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 243088 - sys-apps/openrc-0.3.0-r1: start-stop-daemon --name doesn't find matching processes
Summary: sys-apps/openrc-0.3.0-r1: start-stop-daemon --name doesn't find matching proc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-21 18:58 UTC by Martin
Modified: 2008-12-20 11:02 UTC (History)
5 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 Martin 2008-10-21 18:58:11 UTC
start-stop-daemon --name doesn't find a matching process to terminate. For an example see:

mrb ~ # /etc/init.d/nfs stop
 * Caching service dependencies ...                                                                                                                                                                                                    [ ok ]
 * Stopping NFS mountd ...                                                                                                                                                                                                             [ ok ]
 * Stopping NFS daemon ...
 * start-stop-daemon: no matching processes found                                                                                                                                                                                      [ !! ]
 * Unexporting NFS directories ...                                                                                                                                                                                                     [ ok ]
 * ERROR: nfs failed to stop

The process nfsd is always running:

mrb ~ # ps axu | grep nfsd
root      2004  0.0  0.0   3948   600 pts/2    S+   20:53   0:00 grep --colour=auto nfsd
root      6562  0.0  0.0      0     0 ?        S    Oct20   0:00 [nfsd]
root      6563  0.0  0.0      0     0 ?        S    Oct20   0:00 [nfsd]
root      6564  0.0  0.0      0     0 ?        S    Oct20   0:00 [nfsd]
root      6565  0.0  0.0      0     0 ?        S    Oct20   0:00 [nfsd]
root      6566  0.0  0.0      0     0 ?        S    Oct20   0:00 [nfsd]

Packages are:
sys-apps/baselayout-2.0.0
net-fs/nfs-utils-1.1.4

I wrote some init scripts for myself and these have the same problem, that processes identified by --name couldn't been stopped anymore.


Reproducible: Always
Comment 1 Mike Auty (RETIRED) gentoo-dev 2008-10-21 23:06:43 UTC
Hiya, could you please include the output of "emerge --info".  It appears start-stop-daemon is part of the openrc package, and emerge --info will tell us which version you have installed, and lots of other useful information.  Thanks...  5:)
Comment 2 Martin 2008-10-22 18:26:30 UTC
Hi Mike,

thank you for the fast answer.

Here the output of emerge --info (sorry)

Portage 2.2_rc12 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r0, 2.6.26-gentoo-r2 x86_64)
=================================================================
System uname: Linux-2.6.26-gentoo-r2-x86_64-Intel-R-_Core-TM-2_Quad_CPU_@_2.40GHz-with-glibc2.2.5
Timestamp of tree: Tue, 21 Oct 2008 16:07:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.1.6-r1
dev-lang/python:     2.5.2-r8
dev-util/cmake:      2.6.2
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.3.0-r1
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18.50.0.9
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.26
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
LDFLAGS="-Wl,-O1"
LINGUAS="de"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac acl alsa amd64 amr arts automount avahi bash-completion berkdb bitmap-fonts bzip2 cdr cli cracklib crypt cups dbus desktop dhcp dri dts dv dvb dvd dvdr dvdread encode esd fax firefox flac font-server fortran gcj gdbm gif glib gphoto2 gpm graphviz gtk hal howl iconv ieee1394 imagemagick imlib ipv6 isdnlog jack java jpeg jpeg2k kde ldap lesstif libcaca lmsensors midi mmx motif mozbranding mp3 mpeg mudflap multilib ncurses neXt network nls nptl nptlonly nsplugin nvidia oav ogg opengl openmp oss pam pch pcre perl png pppd python qt qt3 qt3support qt4 readline reflection samba scanner sdl session slp soundex speex spell spl sse sse2 ssl sysfs syslog tcl tcpd tetex theora threads tiff tk toolbar truetype truetype-fonts type1 type1-fonts unicode urandom v4l vcd vdr vorbis wavpack wifi winbind xine xinerama xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="nv nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Btw. I have a second computer with the same problem. On this is also openrc-0.3.0-r1 installed with similar configuration. But today I can not generate a "emerge --info"  for this computer. I can do this tomorrow.  

Regards
Martin
Comment 3 Mike Auty (RETIRED) gentoo-dev 2008-10-22 22:25:54 UTC
One should be fine to get us started thanks Martin.  5:)
Comment 4 Martin 2008-10-23 17:19:45 UTC
Additional Info:

On the same system :

mrb ~ # /etc/init.d/postgresql stop
 * Stopping PostgreSQL ...                                                                                                                                                                                                           [ !! ]
 * ERROR: postgresql failed to stop

Postgres also failed to stop

mrb ~ # emerge -pv postgresql

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] dev-db/postgresql-8.2.7  USE="nls pam perl python readline ssl tcl xml zlib -doc -kerberos -pg-intdatetime (-selinux) -test" 0 kB
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2008-10-23 18:12:46 UTC
(In reply to comment #4)
> Additional Info:
> 
> On the same system :
> 
> mrb ~ # /etc/init.d/postgresql stop
>  * Stopping PostgreSQL ...                                                     
>                                                                                
>                                                                      [ !! ]
>  * ERROR: postgresql failed to stop
> 
> Postgres also failed to stop
> 
> mrb ~ # emerge -pv postgresql
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> [ebuild   R   ] dev-db/postgresql-8.2.7  USE="nls pam perl python readline ssl
> tcl xml zlib -doc -kerberos -pg-intdatetime (-selinux) -test" 0 kB
> 

Completely separate issue, PostgreSQL's init script does not use start-stop-daemon
Comment 6 Martin 2008-10-23 20:02:48 UTC
Doug are you shure?

If I make a cat /etc/init.d/postgresql I can see the following:

stop() {
        ebegin "Stopping PostgreSQL"
        # Note: we have to do --oknodo here, otherwise it will always fail
        #       when there are open transactions. This bug has been corrected
        #       in baselayout-1.13.0_alpha8.
        start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
                --retry -TERM/${WAIT_FOR_DISCONNECT}/-INT/${WAIT_FOR_CLEANUP}/-QUIT --oknodo
        eend $?
}
Comment 7 Doug Goldstein (RETIRED) gentoo-dev 2008-10-23 20:12:38 UTC
(In reply to comment #6)
> Doug are you shure?
> 
> If I make a cat /etc/init.d/postgresql I can see the following:
> 
> stop() {
>         ebegin "Stopping PostgreSQL"
>         # Note: we have to do --oknodo here, otherwise it will always fail
>         #       when there are open transactions. This bug has been corrected
>         #       in baselayout-1.13.0_alpha8.
>         start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \
>                 --retry
> -TERM/${WAIT_FOR_DISCONNECT}/-INT/${WAIT_FOR_CLEANUP}/-QUIT --oknodo
>         eend $?
> }
> 

The bug report is about the --name option, from what you pasted above it's clearly not using the --name option so it's a completely disconnected issued (more then likely it's an issue with the postgresql's own init script) Additionally, the init script that my copy of PostgreSQL installed on my machine doesn't use start-stop-daemon.
Comment 8 Nicholas J. Michalek 2008-10-26 08:02:24 UTC
I'm running the same version of openrc (3.0-r1), and I can't stop/restart the nfs service because of this. Quite annoying. =/
Comment 9 Roy Marples 2008-10-26 20:28:32 UTC
--name is such a bad hack

1) processes can change their "name"
2) it's non portable
3) name has a maximum match of 14 chars on some platforms

We do the best we can, but s-s-d in OpenRC should now be good enougn so that --name is no longer required, as long as the binary it's starting/stopping exists.
Comment 10 Roy Marples 2008-10-30 16:27:15 UTC
I've fixed --name for stopping services like nfs.

http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=0492240d1b2e09629e32faa37fa07094c2a4ad59
Comment 11 barthek 2008-12-03 17:11:20 UTC
when is this going to be pushed to portage?
Comment 12 Nicholas J. Michalek 2008-12-03 20:37:07 UTC
(In reply to comment #9)
> We do the best we can, but s-s-d in OpenRC should now be good enougn so that
> --name is no longer required, as long as the binary it's starting/stopping
> exists.
> 

Current command that fails in the nfs initscript:
>start-stop-daemon --stop --oknodo --name nfsd --user root --signal 2

How would you suggest modifying this to do it without using --name?

If we can prove there is a better way to do it in every case, we can declare it deprecated, and then focus on updating all initscripts that use it.
Comment 13 Roy Marples 2008-12-03 20:41:38 UTC
(In reply to comment #12)
> Current command that fails in the nfs initscript:
> >start-stop-daemon --stop --oknodo --name nfsd --user root --signal 2
> 
> How would you suggest modifying this to do it without using --name?

nfs changes it's process name AND cannot work with pidfiles (to the best of my knowledge). Yes it's crappy, but it's probably one of the very few exceptions that actually needs --name.
OpenRC had a bug regarding --name which has since been fixed and the nfs script as it stands works again.
Comment 14 Martin 2008-12-20 11:02:06 UTC
Bug seems to be resolved in openrc-4.0

Thank you very match!