Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 567756 - =www-servers/varnish-4.1.0 fails to start: usr/sbin/varnishd: invalid option -- 'u'
Summary: =www-servers/varnish-4.1.0 fails to start: usr/sbin/varnishd: invalid option ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-08 06:57 UTC by Tomáš Mózes
Modified: 2016-05-12 10:31 UTC (History)
1 user (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 Tomáš Mózes 2015-12-08 06:57:32 UTC
Jail options were implemented and the old options got dropped. Maybe we can do something like:

--- varnishd.virgin     2015-12-08 06:42:14.397997561 +0000
+++ varnishd    2015-12-08 06:53:38.288324140 +0000
@@ -12,10 +12,6 @@
 # Alternatively, don't listen to a backend
 VARNISHD_OPTS="-a 127.0.0.1:8080"
 
-
-# User/Group
-VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
-
 # You may need to increase the number of open files (-n)
 # and the maximum amount off locked memory (-l)
 # See bug #459142


--- varnishd.virgin     2015-12-08 06:42:14.324997425 +0000
+++ varnishd    2015-12-08 06:54:52.063384765 +0000
@@ -7,7 +7,7 @@
 CONFIGFILES="${CONFIGFILE:-/etc/varnish/default.vcl}"
 
 command="${VARNISHD:-/usr/sbin/varnishd}"
-command_args="-P ${VARNISHD_PID} -f ${CONFIGFILE} ${VARNISHD_OPTS}"
+command_args="-j unix,user=varnish -P ${VARNISHD_PID} -f ${CONFIGFILE} ${VARNISHD_OPTS}"
 pidfile="${VARNISHD_PID}"
 
 extra_commands="configtest"
 
I tried altering the conf.d, but it reports that the jail option must be the first argument.
Comment 1 Tomáš Mózes 2015-12-08 07:00:00 UTC
The first diff is from conf.d/varnishd, the second is init.d/varnishd, forgot the mention that but I think it's obvious ;)
Comment 2 Anthony Basile gentoo-dev 2015-12-22 04:25:34 UTC
idl0r, any comments?
Comment 3 Christian Ruppert (idl0r) gentoo-dev 2016-01-06 12:42:35 UTC
(In reply to Anthony Basile from comment #2)
> idl0r, any comments?

Yeah, we'll have to remove -u/-g since user/group is hardcoded in 4.1. It's just "varnish" AFAIR.
Comment 4 Anthony Basile gentoo-dev 2016-01-29 10:35:41 UTC
i added 4.1.1 to the tree with this change.  can you please test 4.1.1.  also, I would appreciate a suggestion for a default /etc/varnish/default.vcl so that it works out of the box.
Comment 5 Tomáš Mózes 2016-05-12 07:07:31 UTC
Version 4.1.0 still fails in the default configuration.

# /etc/init.d/varnishd restart
 * Caching service dependencies ...                                                                                                                                                                                                                                                                                      [ ok ]
 * Starting varnishd ...
/usr/sbin/varnishd: invalid option -- 'u'
usage: varnishd [options]
    -a address[:port][,proto]    # HTTP listen address and port (default: *:80)
                                 #   address: defaults to loopback
                                 #   port: port or service (default: 80)
                                 #   proto: HTTP/1 (default), PROXY
    -b address[:port]            # backend address and port
                                 #   address: hostname or IP
                                 #   port: port or service (default: 80)
    -C                           # print VCL code compiled to C language
    -d                           # debug
    -F                           # Run in foreground
    -f file                      # VCL script
    -h kind[,hashoptions]        # Hash specification
                                 #   -h critbit [default]
                                 #   -h simple_list
                                 #   -h classic
                                 #   -h classic,<buckets>
    -i identity                  # Identity of varnish instance
    -j jail[,jailoptions]        # Jail specification
                                 #   -j unix[,user=<user>][,ccgroup=<group>]
                                 #   -j none
    -l vsl[,vsm]                 # Size of shared memory file
                                 #   vsl: space for VSL records [80m]
                                 #   vsm: space for stats counters [1m]
    -M address:port              # Reverse CLI destination
    -n dir                       # varnishd working directory
    -P file                      # PID file
    -p param=value               # set parameter
    -r param[,param...]          # make parameter read-only
    -S secret-file               # Secret file for CLI authentication
    -s [name=]kind[,options]     # Backend storage specification
                                 #   -s malloc[,<size>]
                                 #   -s file,<dir_or_file>
                                 #   -s file,<dir_or_file>,<size>
                                 #   -s file,<dir_or_file>,<size>,<granularity>
                                 #   -s persistent (experimental)
    -T address:port              # Telnet listen address and port
    -t TTL                       # Default TTL
    -V                           # version
    -W waiter                    # Waiter implementation
                                 #   -W epoll
                                 #   -W poll
 * start-stop-daemon: failed to start `/usr/sbin/varnishd'
 * Failed to start varnishd                                                                                                                                                                                                                                                                                              [ !! ]
 * ERROR: varnishd failed to start
Comment 6 Anthony Basile gentoo-dev 2016-05-12 08:20:26 UTC
(In reply to Tomáš Mózes from comment #5)
> Version 4.1.0 still fails in the default configuration.
> 
>

I took 4.1.0 off the tree.  Please use 4.1.2.
Comment 7 Tomáš Mózes 2016-05-12 10:31:11 UTC
Yes that works fine, thanks Anthony.