Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

SOLVED

Always check for those pesky capital letters!

In the privoxytor config file I had typed that the location of the config file as privoxyTor with a capital 'T' -why privoxy needs this I have know idea as it's accessing the file already.


After following the instructions here:

https://trac.torproject.org/projects/tor/wiki/doc/RunTwoPrivoxys

And, excepting one difference - I used the name privoxytor instead of privoxy2, I can't seem to get the second instance of privoxy running and can't find any more error messages.

The original still starts up fine with "service privoxy start", but the new one, while not giving any error messages does not. running "service privoxytor status" gives: "privoxytor is not running ... failed!"

here is my init.d file

! /bin/sh

### BEGIN INIT INFO
# Provides:          privoxytor
# Required-Start:    $local_fs $remote_fs $named $network $time
# Required-Stop:     $local_fs $remote_fs $named $network $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Privacy enhancing HTTP Proxy
# Description:       Privoxy is a web proxy with advanced filtering
#                    capabilities for protecting privacy, filtering
#                    web page content, managing cookies, controlling
#                    access, and removing ads, banners, pop-ups and
#                    other obnoxious Internet junk.
### END INIT INFO

# Author: Roland Rosenfeld <roland@debian.org>

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="filtering parent proxy server for Tor"
NAM=privoxy
NAME=${NAM}tor
echo $NAME
DAEMON=/usr/sbin/${NAME}
echo $DAEMON
PIDFILE=/var/run/${NAME}.pid
echo $PIDFILE
OWNER=${NAME}
echo $OWNER
CONFIGFILE=/etc/${NAME}/config
echo $CONFIGFILE
DAEMON_ARGS="--pidfile $PIDFILE --user $OWNER $CONFIGFILE"
SCRIPTNAME=/etc/init.d/${NAME}
LOGDIR=/var/log/${NAME}
DEFAULTSFILE=/etc/default/${NAM}

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r $DEFAULTSFILE ] && . $DEFAULTSFILE

# Create log directory if it does not exist
if [ ! -d "$LOGDIR" ]; then
    mkdir -m 750 $LOGDIR
    chown $OWNER:adm $LOGDIR
fi

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
            || return 1
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
            $DAEMON_ARGS \
            || return 2
        # Add code here, if necessary, that waits for the process to be ready
        # to handle requests from services started subsequently which depend
        # on this one.  As a last resort, sleep for some time.
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
        RETVAL="$?"
        [ "$RETVAL" = 2 ] && return 2
        # Wait for children to finish too if this is a daemon that forks
        # and if the daemon is only ever run from this initscript.
        # If the above conditions are not satisfied then add some other code
        # that waits for the process to drop all resources that could be
        # needed by services started subsequently.  A last resort is to
        # sleep for some time.
        start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
        [ "$?" = 2 ] && return 2
        # Many daemons don't delete their pidfiles when they exit.
        rm -f $PIDFILE
        return "$RETVAL"
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
        #
        # If the daemon can reload its configuration without
        # restarting (for example, when it is sent a SIGHUP),
        # then implement that here.
        #
        start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
        return 0
}


case "$1" in
  start)
        if [ "$RUN_DAEMON" = "no" ]; then
            [ "$VERBOSE" != no ] && log_warning_msg "Not starting $DESC (disabled in $DEFAULTSFILE)."
            exit 0
        fi

        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  #reload|force-reload)
        #
        # If do_reload() is not implemented then leave this commented out
        # and leave 'force-reload' as an alias for 'restart'.
        #
        #log_daemon_msg "Reloading $DESC" "$NAME"
        #do_reload
        #log_end_msg $?
        #;;
  restart|force-reload)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        if [ "$RUN_DAEMON" = "no" ]; then
            [ "$VERBOSE" != no ] && log_warning_msg "Not restarting $DESC (disabled in $DEFAULTSFILE)."
            exit 0
        fi

        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
            do_start
            case "$?" in
                0) log_end_msg 0 ;;
                1) log_end_msg 1 ;; # Old process is still running
                *) log_end_msg 1 ;; # Failed to start
            esac
            ;;
          *)
            # Failed to stop
            log_end_msg 1
            ;;
        esac
        ;;
  status)
        status_of_proc "$DAEMON" "$NAME"
        exit $?
        ;;

  *)
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
        exit 3
        ;;
esac

:

And here is the result of "strace /etc/init.d/privoxytor start"

execve("/etc/init.d/privoxytor", ["/etc/init.d/privoxytor", "start"], [/* 22 vars */]) = 0
brk(0)                                  = 0x161c000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95c7000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=98415, ...}) = 0
mmap(NULL, 98415, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4df95ae000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\357\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1595408, ...}) = 0
mmap(NULL, 3709016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f4df9020000
mprotect(0x7f4df91a0000, 2097152, PROT_NONE) = 0
mmap(0x7f4df93a0000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x180000) = 0x7f4df93a0000
mmap(0x7f4df93a5000, 18520, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4df93a5000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ad000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ac000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ab000
arch_prctl(ARCH_SET_FS, 0x7f4df95ac700) = 0
mprotect(0x7f4df93a0000, 16384, PROT_READ) = 0
mprotect(0x7f4df95c9000, 4096, PROT_READ) = 0
munmap(0x7f4df95ae000, 98415)           = 0
getpid()                                = 2698
rt_sigaction(SIGCHLD, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0
geteuid()                               = 0
brk(0)                                  = 0x161c000
brk(0x163d000)                          = 0x163d000
getppid()                               = 2697
stat("/etc/privoxytor", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/etc/init.d/privoxytor", O_RDONLY) = 3
fcntl(3, F_DUPFD, 10)                   = 10
close(3)                                = 0
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0
read(10, "#! /bin/sh\n### BEGIN INIT INFO\n#"..., 8192) = 5094
write(1, "privoxytor\n", 11privoxytor
)            = 11
write(1, "/usr/sbin/privoxytor\n", 21/usr/sbin/privoxytor
)  = 21
write(1, "/var/run/privoxytor.pid\n", 24/var/run/privoxytor.pid
) = 24
write(1, "privoxytor\n", 11privoxytor
)            = 11
write(1, "/etc/privoxytor/config\n", 23/etc/privoxytor/config
) = 23
geteuid()                               = 0
stat("/usr/sbin/privoxytor", {st_mode=S_IFREG|0755, st_size=273616, ...}) = 0
faccessat(AT_FDCWD, "/usr/sbin/privoxytor", X_OK) = 0
faccessat(AT_FDCWD, "/etc/default/privoxy", R_OK) = -1 ENOENT (No such file or directory)
stat("/var/log/privoxytor", {st_mode=S_IFDIR|0750, st_size=6, ...}) = 0
open("/lib/init/vars.sh", O_RDONLY)     = 3
fcntl(3, F_DUPFD, 10)                   = 11
close(3)                                = 0
fcntl(11, F_SETFD, FD_CLOEXEC)          = 0
read(11, "#\n# Set rcS vars\n#\n\n# Because /e"..., 8192) = 1228
stat("/etc/default/rcS", {st_mode=S_IFREG|0644, st_size=620, ...}) = 0
open("/etc/default/rcS", O_RDONLY)      = 3
fcntl(3, F_DUPFD, 10)                   = 12
close(3)                                = 0
fcntl(12, F_SETFD, FD_CLOEXEC)          = 0
read(12, "#\n# /etc/default/rcS\n#\n# Default"..., 8192) = 620
read(12, "", 8192)                      = 0
close(12)                               = 0
faccessat(AT_FDCWD, "/proc/cmdline", R_OK) = 0
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2703
close(4)                                = 0
read(3, "BOOT_IMAGE=/boot/vmlinuz-3.2.0-4"..., 128) = 95
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2703
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigreturn(0x11)                      = 2703
read(11, "", 8192)                      = 0
close(11)                               = 0
open("/lib/lsb/init-functions", O_RDONLY) = 3
fcntl(3, F_DUPFD, 10)                   = 11
close(3)                                = 0
fcntl(11, F_SETFD, FD_CLOEXEC)          = 0
read(11, "# /lib/lsb/init-functions for De"..., 8192) = 8192
read(11, " \" * Starting remote filesystem "..., 8192) = 3253
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2704
close(4)                                = 0
read(3, "/lib/lsb/init-functions.d/20-lef"..., 128) = 46
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2704
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigreturn(0x11)                      = 2704
faccessat(AT_FDCWD, "/lib/lsb/init-functions.d/20-left-info-blocks", R_OK) = 0
open("/lib/lsb/init-functions.d/20-left-info-blocks", O_RDONLY) = 3
fcntl(3, F_DUPFD, 10)                   = 12
close(3)                                = 0
fcntl(12, F_SETFD, FD_CLOEXEC)          = 0
read(12, "# Default info blocks put to the"..., 8192) = 1093
read(12, "", 8192)                      = 0
close(12)                               = 0
stat("/etc/lsb-base-logging.sh", {st_mode=S_IFREG|0755, st_size=11, ...}) = 0
open("/etc/lsb-base-logging.sh", O_RDONLY) = 3
fcntl(3, F_DUPFD, 10)                   = 12
close(3)                                = 0
fcntl(12, F_SETFD, FD_CLOEXEC)          = 0
read(12, "FANCYTTY=0\n", 8192)          = 11
read(12, "", 8192)                      = 0
close(12)                               = 0
read(11, "", 8192)                      = 0
close(11)                               = 0
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fcntl(1, F_DUPFD, 10)                   = 11
close(1)                                = 0
fcntl(11, F_SETFD, FD_CLOEXEC)          = 0
dup2(3, 1)                              = 1
close(3)                                = 0
stat("/sbin/start-stop-daemon", {st_mode=S_IFREG|0755, st_size=28152, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2707
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2707
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigreturn(0x11)                      = 2707
dup2(11, 1)                             = 1
close(11)                               = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2708
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 2708
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigreturn(0x11)                      = 2708
read(10, "", 8192)                      = 0
exit_group(0)      
share|improve this question
    
Arhg! Solved it almost as soon as I posted. In the privoxytor config file I had typed that the location of the config file as privoxyTor with a capital 'T' -why privoxy needs this I have know idea as it's accessing the file already. Sorry for wasting anyone's time. –  user36463 Apr 4 '13 at 3:36
1  
If you could, can you put the answer to your question in the answer section below and mark it as the accepted answer. Also remove the answer portion from the question. this will make it more consistent with how the rest of the site presents to users. Providing the details to both the Q & A is never a waste of time! –  slm Apr 4 '13 at 3:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.