Discussion:
stunnel not running? (check /var/run/stunnel/stunnel.pid)
Noah
2008-06-07 02:31:11 UTC
Permalink
Okay I am not understanding something with stunnel. it appears that
stunnel cant start because it cant create a pid file. It happens every
time I upgrade it.

# /usr/local/etc/rc.d/stunnel restart
stunnel not running? (check /var/run/stunnel/stunnel.pid).
Starting stunnel.
# /usr/local/etc/rc.d/stunnel restart
stunnel not running? (check /var/run/stunnel/stunnel.pid).
Starting stunnel.
#

Anybody help me understand things here. so here is the relevent output
which I can provide some clues.


# ls -ld /var/run/stunnel/
drwxrwxr-x 2 stunnel stunnel 512 Jun 5 14:28 /var/run/stunnel/
# cat /usr/local/etc/stunnel/stunnel.conf
# Sample stunnel configuration file
# Copyright by Michal Trojnara 2002

# Comment it out on Win32
cert = /usr/local/etc/stunnel/mail.pem
chroot = /var/run/stunnel
#chroot = /var/run
# PID is created inside chroot jail
pid = /stunnel.pid
setuid = stunnel
setgid = stunnel
# grep stunnel /etc/rc.conf
stunnel_enable="YES"
# cat /usr/local/etc/rc.d/stunnel
#!/bin/sh
#
# $FreeBSD: ports/security/stunnel/files/stunnel.in,v 1.9 2008/01/26
14:18:12 roam Exp $
#

# PROVIDE: stunnel
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

#
# Add some of the following variables to /etc/rc.conf to configure stunnel:
# stunnel_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable stunnel.
# stunnel_config (str): Default
"/usr/local/etc/stunnel/stunnel.conf"
# Set it to the full path to the config file
# that stunnel will use during the automated
# start-up.
# stunnel_pidfile (str): Default "/usr/local/var/stunnel/stunnel.pid"
# Set it to the value of 'pid' in
# the stunnel.conf file.
#

. /etc/rc.subr

name="stunnel"
rcvar=`set_rcvar`

load_rc_config $name

: ${stunnel_enable="NO"}
: ${stunnel_config="/usr/local/etc/stunnel/${name}.conf"}
: ${stunnel_pidfile="/var/run/stunnel/${name}.pid"}

command="/usr/local/bin/stunnel"
command_args=${stunnel_config}
pidfile=${stunnel_pidfile}

required_files="${stunnel_config}"

run_rc_command "$1"



------

any ideas?

Cheers,

Noah
Sahil Tandon
2008-06-07 15:43:13 UTC
Permalink
Okay I am not understanding something with stunnel. it appears that stunnel
cant start because it cant create a pid file. It happens every time I
upgrade it.
# /usr/local/etc/rc.d/stunnel restart
stunnel not running? (check /var/run/stunnel/stunnel.pid).
Starting stunnel.
# /usr/local/etc/rc.d/stunnel restart
stunnel not running? (check /var/run/stunnel/stunnel.pid).
Starting stunnel.
#
Anybody help me understand things here. so here is the relevent output
which I can provide some clues.
I notice below that you have modified the rc script, but even after mimicking
your changes, I cannot reproduce your problem -- stunnel starts (and creates
a pid) just fine. What is logged to /var/log/messages by stunnel?

[...]
--
Sahil Tandon <***@tandon.net>
Noah
2008-06-07 17:39:59 UTC
Permalink
logs included below
Post by Sahil Tandon
Okay I am not understanding something with stunnel. it appears that stunnel
cant start because it cant create a pid file. It happens every time I
upgrade it.
# /usr/local/etc/rc.d/stunnel restart
stunnel not running? (check /var/run/stunnel/stunnel.pid).
Starting stunnel.
# /usr/local/etc/rc.d/stunnel restart
stunnel not running? (check /var/run/stunnel/stunnel.pid).
Starting stunnel.
#
Anybody help me understand things here. so here is the relevent output
which I can provide some clues.
I notice below that you have modified the rc script, but even after mimicking
your changes, I cannot reproduce your problem -- stunnel starts (and creates
a pid) just fine. What is logged to /var/log/messages by stunnel?
2008.06.07 10:37:55 LOG7[27645:134664192]: Snagged 64 random bytes from
/root/.rnd
2008.06.07 10:37:55 LOG7[27645:134664192]: Wrote 1024 new random bytes
to /root/.rnd
2008.06.07 10:37:55 LOG7[27645:134664192]: RAND_status claims sufficient
entropy for the PRNG
2008.06.07 10:37:55 LOG7[27645:134664192]: PRNG seeded successfully
2008.06.07 10:37:55 LOG7[27645:134664192]: Certificate:
/usr/local/etc/stunnel/mail.pem
2008.06.07 10:37:55 LOG7[27645:134664192]: Certificate loaded
2008.06.07 10:37:55 LOG7[27645:134664192]: Key file:
/usr/local/etc/stunnel/mail.pem
2008.06.07 10:37:55 LOG7[27645:134664192]: Private key loaded
2008.06.07 10:37:55 LOG7[27645:134664192]: SSL context initialized for
service pop3s
2008.06.07 10:37:55 LOG5[27645:134664192]: stunnel 4.25 on
i386-unknown-freebsd6.2 with OpenSSL 0.9.8h 28 May 2008
2008.06.07 10:37:55 LOG5[27645:134664192]: Threading:PTHREAD SSL:ENGINE
Sockets:POLL,IPv6 Auth:LIBWRAP
2008.06.07 10:37:55 LOG6[27645:134664192]: file ulimit = 11095 (can be
changed with 'ulimit -n')
2008.06.07 10:37:55 LOG6[27645:134664192]: poll() used - no FD_SETSIZE
limit for file descriptors
2008.06.07 10:37:55 LOG5[27645:134664192]: 5417 clients allowed
2008.06.07 10:37:55 LOG7[27645:134664192]: FD 5 in non-blocking mode
2008.06.07 10:37:55 LOG7[27645:134664192]: FD 6 in non-blocking mode
2008.06.07 10:37:55 LOG7[27645:134664192]: FD 7 in non-blocking mode
2008.06.07 10:37:55 LOG7[27645:134664192]: SO_REUSEADDR option set on
accept socket
2008.06.07 10:37:55 LOG7[27645:134664192]: pop3s bound to 0.0.0.0:995
2008.06.07 10:37:55 LOG3[27646:134664192]: Cannot create pid file
/tmp/stunnel.pid
2008.06.07 10:37:55 LOG3[27646:134664192]: create: No such file or
directory (2)
Post by Sahil Tandon
[...]
Sahil Tandon
2008-06-07 19:33:40 UTC
Permalink
Post by Noah
2008.06.07 10:37:55 LOG3[27646:134664192]: Cannot create pid file
/tmp/stunnel.pid
It should not be trying to create a pid file in /tmp. There is a
configuration file being read that is directly stunnel to that location.
--
Sahil Tandon <***@tandon.net>
Adamsonh
2008-06-09 08:49:17 UTC
Permalink
Post by Noah
Okay I am not understanding something with stunnel. it appears that
stunnel cant start because it cant create a pid file. It happens every
time I upgrade it.
# /usr/local/etc/rc.d/stunnel restart
stunnel not running? (check /var/run/stunnel/stunnel.pid).
Starting stunnel.
# /usr/local/etc/rc.d/stunnel restart
stunnel not running? (check /var/run/stunnel/stunnel.pid).
Starting stunnel.
#
Anybody help me understand things here. so here is the relevent output
which I can provide some clues.
# ls -ld /var/run/stunnel/
drwxrwxr-x 2 stunnel stunnel 512 Jun 5 14:28 /var/run/stunnel/
# cat /usr/local/etc/stunnel/stunnel.conf
# Sample stunnel configuration file
# Copyright by Michal Trojnara 2002
# Comment it out on Win32
cert = /usr/local/etc/stunnel/mail.pem
chroot = /var/run/stunnel
#chroot = /var/run
# PID is created inside chroot jail
pid = /stunnel.pid
setuid = stunnel
setgid = stunnel
# grep stunnel /etc/rc.conf
stunnel_enable="YES"
# cat /usr/local/etc/rc.d/stunnel
#!/bin/sh
#
# $FreeBSD: ports/security/stunnel/files/stunnel.in,v 1.9 2008/01/26
14:18:12 roam Exp $
#
# PROVIDE: stunnel
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# stunnel_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable stunnel.
# stunnel_config (str): Default
"/usr/local/etc/stunnel/stunnel.conf"
# Set it to the full path to the config file
# that stunnel will use during the automated
# start-up.
# stunnel_pidfile (str): Default
"/usr/local/var/stunnel/stunnel.pid"
# Set it to the value of 'pid' in
# the stunnel.conf file.
#
. /etc/rc.subr
name="stunnel"
rcvar=`set_rcvar`
load_rc_config $name
: ${stunnel_enable="NO"}
: ${stunnel_config="/usr/local/etc/stunnel/${name}.conf"}
: ${stunnel_pidfile="/var/run/stunnel/${name}.pid"}
command="/usr/local/bin/stunnel"
command_args=${stunnel_config}
pidfile=${stunnel_pidfile}
required_files="${stunnel_config}"
run_rc_command "$1"
------
any ideas?
Cheers,
Noah
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
ps auxw |grep stunnel
sockstat -4 |grep stunnel
clear anything stunnel before restart.
--
View this message in context: http://www.nabble.com/stunnel-not-running--%28check--var-run-stunnel-stunnel.pid%29-tp17704688p17728757.html
Sent from the freebsd-questions mailing list archive at Nabble.com.
Loading...