When trying to start asterisk (1.2.21.1) from init script the following error message occurs: # /etc/init.d/asterisk start * Starting asterisk PBX (as asterisk) ... Unable to open pid file '/var/run/asterisk.pid': Permission denied cat: /var/run/asterisk/asterisk.pid: No such file or directory [ !! ] it tries to write pid file in the wrong directory /var/run instead of /var/run/asterisk asterisk is however launched, but cannot be stopped since there is no pid file. /var/log/asterisk and all files therein are owned by asterisk:asterisk same goes for /var/run/asterisk Reproducible: Always Steps to Reproduce: 1./etc/init.d/asterisk start 2. 3. Actual Results: asterisk is started but no pid file is written, hence it cannot be stopped from init scripts and since asterisk.ctl is missing too there is no way to connect to asterisk either. Expected Results: asterisk should have written the pid file in the correct directory and be able to be stopped and/or accessed with 'asterisk -r' command. # emerge --info Portage 2.1.3.19 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-gentoo-r9 x86_64) ================================================================= System uname: 2.6.22-gentoo-r9 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ Timestamp of tree: Mon, 19 Nov 2007 08:30:08 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p17 dev-java/java-config: 1.3.7, 2.0.33-r1 dev-lang/python: 2.4.4-r6 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 1.12.9-r2 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.61-r1 sys-devel/automake: 1.7.9-r1, 1.9.6-r2, 1.10 sys-devel/binutils: 2.18-r1 sys-devel/gcc-config: 1.3.16 sys-devel/libtool: 1.5.24 virtual/os-headers: 2.6.22-r2 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=k8 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /opt/openfire/resources/security/ /usr/share/X11/xkb" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-march=k8 -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="candy ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" 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.gentoo.org/gentoo-portage" USE="X acl alsa amd64 berkdb bitmap-fonts bzip2 cairo cli cracklib crypt cups dri fam foomaticdb fortran gdbm gif gpm gtk2 hardened iconv imagemagick isdnlog jpeg maildir midi mmx mudflap ncurses nls nptl nptl-only nptlonly ogg opengl openmp oss pam pcre pdf perl png ppds pppd python qt3 qt4 readline reflection samba session spell spl sse sse2 ssl subversion svg tcltk tcpd threads tiff truetype truetype-fonts type1-fonts unicode usb xml xml2 xorg xpm xprint 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 mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" MISDN_CARDS="hfcpci" USERLAND="GNU" VIDEO_CARDS="vesa nv vga nvidia" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Created attachment 136362 [details] added the /etc/init.d/asterisk start --debug output Added the output of the init script with --debug flag to better clarify the issue.
Attach the initscript here, please.
Created attachment 136369 [details] the /etc/init.d/asterisk init script
Doesn't make sense...
I use net-misc/asterisk-1.2.21.1-r1 Steps to Reproduce: 1./etc/init.d/asterisk start 2./etc/init.d/asterisk stop Actual Results: asterisk is started, pid ant ctl-file exists in /var/run/asterisk/. Running step 2 running in error: cat: /var/run/asterisk/asterisk.pid: No such file or directory Asterisk is still alive. Expected Results: asterisk should down cleanly witout errors. emerge --info Portage 2.1.3.19 (default-linux/x86/no-nptl, gcc-4.1.2, glibc-2.5-r4, 2.6.22-gentoo-r9 i686) ================================================================= System uname: 2.6.22-gentoo-r9 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Timestamp of tree: Thu, 15 Nov 2007 12:05:01 +0000 app-shells/bash: 3.2_p17 dev-lang/python: 2.4.4-r6 dev-python/pycrypto: 2.0.1-r6 sys-apps/baselayout: 1.12.9-r2 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.61-r1 sys-devel/automake: 1.9.6-r2, 1.10 sys-devel/binutils: 2.18-r1 sys-devel/gcc-config: 1.3.16 sys-devel/libtool: 1.5.24 virtual/os-headers: 2.6.22-r2 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -mtune=i686 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -mtune=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="buildpkg digest distlocks metadata-transfer noinfo sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" MAKEOPTS="-j2" 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.gentoo.org/gentoo-portage" USE="alsa apm bash-completion berkdb bitmap-fonts bri cli cracklib crypt cups dri eds emboss encode foomaticdb fortran gdbm gif gnome gpm gstreamer iconv ipv6 isdnlog jpeg kde libwww mad midi mikmod mmx motif mp3 mpeg mudflap ncurses nls ogg openmp pam pcre perl png pppd python qt3 qt4 quicktime readline reflection rtc sdl session spell spl sse ssl tcpd truetype truetype-fonts type1-fonts vorbis x86 xml xorg zaptel 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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
I'm sorry to see that this bug got ignored for so long. To the best of my knowledge it is fixed in the 1.2.27 ebuild, and I can vouch for it working correctly in 1.6.0.6