Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 571448

Summary: www-servers/boa-0.94.14_rc21-r1 fails to stop
Product: Gentoo Linux Reporter: georg
Component: [OLD] ServerAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: mgorny
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Adjusted init.d script
boa.initd
boa.conf.patch
boa.ebuild.patch
boa.initd.patch

Description georg 2016-01-10 08:22:17 UTC
"/etc/init.d/start" starts the deamon
"/etc/init.d/boa stop" should stop it but the process is still there.





Reproducible: Always

Steps to Reproduce:
1. Install boa
2. start boa 
3. try to stop it
4. pgrep boa shows it is still there
Actual Results:  
Fails to stop

Expected Results:  
Server should stop

With an added "PidFile" directive in /etc/boa/boa.conf

The appended 

# The PID File
PidFile /run/boa.pid

to boa.conf

and the appended init.d script it works like expected
Comment 1 georg 2016-01-10 08:23:28 UTC
Created attachment 422440 [details]
Adjusted init.d script

Adjusted boa start script
Comment 2 georg 2016-01-10 08:24:15 UTC
emerge --info boa
Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop, gcc-5.2.0, glibc-2.21-r1, 4.1.2-slim x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.2-slim-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-gentoo-2.2
KiB Mem:    16359488 total,   8512880 free
KiB Swap:          0 total,         0 free
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.4::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 5.2.0::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://192.168.177.1/portage.git
    priority: -1000

x11
    location: /var/lib/layman/x11
    masters: gentoo
    priority: 0

sardemff7
    location: /var/lib/layman/sardemff7
    masters: gentoo
    priority: 1

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 2

user-schorsch_76
    location: /var/lib/layman/user/schorsch_76
    masters: gentoo
    priority: 3

user-schorsch-tech
    location: /var/lib/layman/user/schorsch-tech
    masters: gentoo
    priority: 4

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -mcx16 -mpopcnt -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=amdfam10 -mcx16 -mpopcnt -pipe"
DISTDIR="/usr/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j16"
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"
USE="X a52 aac acl acpi alsa amd64 berkdb branding bzip2 cairo cdr cli cracklib crypt cups cxx dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpg gpm gtk gtk3 iconv ipv6 jpeg lcms ldap mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png ppds qt3support qt4 readline sdl seccomp session smtp spell sse sse2 ssl startup-notification svg tcpd tiff truetype unicode usb vdpau vorbis wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid dav dav_fs dav_lock 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" 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" CPU_FLAGS_X86="aes avx fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" 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 ublox ubx" INPUT_DEVICES="keyboard mouse wacom evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 i386 arm" QEMU_USER_TARGETS="x86_64 i386 arm" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="radeon r600 radeonsi amdgpu" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

www-servers/boa-0.94.14_rc21-r1::gentoo was built with the following:
USE="-doc" ABI_X86="64"
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-01-13 15:11:53 UTC
I'm sorry, I'm not using openrc. @openrc, could you handle this, please?
Comment 4 William Hubbs gentoo-dev 2016-01-21 17:31:15 UTC
Created attachment 423538 [details]
boa.initd

Hi,

please test with this init script; the previously attached script was
doing several things that OpenRC handles internally; let me know if this
one works.

Thanks,

William
Comment 5 georg 2016-01-21 21:32:44 UTC
This script still fails.

etc/init.d/boa start
 * Caching service dependencies ...                                       [ ok ]
 * Starting boa ...                                                       [ ok ]
machariel georg # pgrep boa
27326
machariel georg # /etc/init.d/boa stop
 * Stopping boa ...                                                       [ ok ]
machariel georg # pgrep boa
27326
machariel georg # 

On this machine is sys-apps/openrc-0.18.4
Comment 6 georg 2016-01-21 21:40:19 UTC
I checked it again. Without
PidFile /run/boa.pid

in boa.conf it fails.

With that directive, it works as expected :)
Comment 7 georg 2016-01-21 21:41:07 UTC
Test with PidFile setting in boa.conf

machariel georg # pgrep boa
27692
machariel georg # /etc/init.d/boa stop
 * Stopping boa ...                                                       [ ok ]
machariel georg # pgrep boa
machariel georg #
Comment 8 William Hubbs gentoo-dev 2016-01-21 23:01:44 UTC
If you do not put a pid file directive in boa.conf, where does the pid
file end up?
Comment 9 William Hubbs gentoo-dev 2016-01-21 23:02:45 UTC
Or better yet, is there a command line option that sets the pid file
like the directive in boa.conf?
Comment 10 georg 2016-01-22 20:27:40 UTC
According to the documentation, there is no command line option.
http://www.boa.org/documentation/

and

boa --help
boa: invalid option -- '-'
Usage: boa [-c serverroot] [-d] [-f configfile] [-r chroot] [-l debug_level]
  To calculate the debug level, logically 'or'
  some of the following values together to get a debug level:
	1:	Alias
	2:	CGI Output
	4:	CGI Input
	8:	CGI Environment
	16:	Header Read State
	32:	Pipeline
	64:	Plugin Error
	128:	Range related
	256:	Configuration
	512:	Buffer I/O
	1024:	Body Read State
	2048:	mmap Cache
	4096:	Generic Request
	8192:	hash table

and

machariel build # /etc/init.d/boa start
 * Starting boa ...                                                                    [ ok ]
machariel build # pgrep boa
7589
machariel build # find / -name boa.pid
machariel build # 

doesnt find anything. So the pid file directive is necessary.
Comment 11 William Hubbs gentoo-dev 2016-01-28 19:22:31 UTC
I don't have boa installed here, so is there a command line switch that
is the equivalent of the pidfile directive?
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-01-28 19:51:09 UTC
No, at least according to manpage and help.
Comment 13 William Hubbs gentoo-dev 2016-01-28 20:59:24 UTC
n that case, the script you want is the one I attached, but some how you
have to either set up a config file with the pidfile directive that
everyone would get or use ewarns to tell people what to set in the
config file if they are using OpenRC.
Comment 14 William Hubbs gentoo-dev 2016-01-28 22:18:49 UTC
Created attachment 424104 [details, diff]
boa.conf.patch

@mgorny:
This is the change to the config file.
following this will be the ebuild and the service script changes.
Comment 15 William Hubbs gentoo-dev 2016-01-28 22:20:22 UTC
Created attachment 424106 [details, diff]
boa.ebuild.patch

@mgorny:
This is the changes to the ebuild.
Comment 16 William Hubbs gentoo-dev 2016-01-28 22:22:16 UTC
Created attachment 424108 [details, diff]
boa.initd.patch

@mgorny:
Here are the changes to the service script.

Please let me know when you want me to commit these.

Thanks,

William
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-01-29 07:59:43 UTC
Feel free to commit if it works ;-).
Comment 18 William Hubbs gentoo-dev 2016-01-29 17:16:05 UTC
This is fixed in boa-0.14.94_rc21-r2.