It's nice to be able to do both.


2013/7/2 Joseph Anthony Pasquale Holsten <notifications@github.com>

> In contrib/docker-registry.conf:
>
> > +
> > +
> > +pre-start script
> > +    [ -f /etc/default/docker-registry ] && . /etc/default/docker-registry
> > +
> > +    dir=$(dirname $LOG_FILE)
> > +    test -d $dir || mkdir -p $dir
> > +end script
> > +
> > +
> > +script
> > +    [ -f /etc/default/docker-registry ] && . /etc/default/docker-registry
> > +
> > +    [ -r $REGISTRY_DIR/.venv/bin/activate ] && . $REGISTRY_DIR/.venv/bin/activate
> > +    cd $REGISTRY_DIR
> > +    exec gunicorn -w $NUM_WORKERS --bind=$ADDRESS --user=$USER --group=$GROUP --log-level=$LOG_LEVEL --log-file=$LOG_FILE 2>>$LOG_FILE wsgi:application
>
> is there a particular reason you want to run this as root and switch down
> to $USER:$GROUP? Is it so you can override the user in the defaults file?
> Or to allow it to bind to a low port?
>
> Otherwise, the normal upstart notation to change user<http://upstart.ubuntu.com/cookbook/#setuid>is
>
> setuid www-data
> setgid www-data
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dotcloud/docker-registry/pull/19/files#r4988150>
> .
>