RedpointArchive / phabricator

A Docker image that runs Phabricator, an open source software engineering tool
https://hub.docker.com/r/redpointgames/phabricator/
307 stars 98 forks source link

20-postfix: redirecting to systemctl start postfix.service #11

Closed lsyoyo closed 9 years ago

lsyoyo commented 9 years ago

I started the container by: docker run -p 80:80 -p 443:443 -p 22:22 -p 22280:22280 -v $(pwd)/config:/config -v $(pwd)/repo:/srv/repo --name=phabricator --link mariadb:linked_mariadb hachque/phabricator

It failed at

[ STARTING ] /etc/init.simple/20-postfix redirecting to systemctl start postfix.service Failed to get D-Bus connection: No connection to service manager. [ FAILED ] /etc/init.simple/20-postfix

However, the command "/etc/init.d/postfix start" works if I run bash in container, and run it directly.

If I run /init in bash it gives the same error.

After removing 20-postfix, the images works fine though.

digitalhoax commented 9 years ago

Having the same issue, I was wondering how you removed 20-postfix?

abcfy2 commented 9 years ago

Same issue here, how to fix?

hach-que commented 9 years ago

You'll need to modify the 20-postfix script to launch postfix directly instead of calling /etc/init.d/postfix, however I won't get time to look into the issue for at least a month, so if someone wants to submit a PR that fixes the issue, that'd be great.

On Tue, Oct 13, 2015, 23:12 Feng Yu notifications@github.com wrote:

Same issue here, how to fix?

— Reply to this email directly or view it on GitHub https://github.com/hach-que-docker/phabricator/issues/11#issuecomment-147697337 .

robwiss commented 9 years ago

It looks like opensuse does something to redirect calls to /etc/init.d scripts to systemd.

From /etc/rc.status:

# Check if the service is used under systemd but not started with
if test -z "$SYSTEMD_NO_WRAP" && /usr/bin/mountpoint -q /sys/fs/cgroup/systemd; then
    if test $PPID -ne 1 -a $# -eq 1 ; then
    _rc_base=
    _sd_opts=
    case "$0" in
    /etc/init.d/boot.*)
        _rc_base=${0##*/boot.} ;;
    /etc/init.d/*|/etc/rc.d/*)
        _rc_base=${0##*/} ;;
    */rc*)
        if test -L "$0"; then
        _rc_base=`readlink "$0"`
        _rc_base=${_rc_base##*/}
        case "$_rc_base" in
        boot.*) _rc_base=${_rc_base#boot.}
        esac
        else
        _rc_base=${0##*/rc}
        fi
        ;;
    esac
    case "$1" in
        status)
        SYSTEMD_NO_WRAP=1 "$0" "$1"
        _sd_opts='--lines=0 --full --output=cat'
        ;;
        start|stop|reload|restart|try-restart|force-reload)
        echo "redirecting to systemctl $1 ${_rc_base}.service" 1>&2
        ;;
        *)  unset _rc_base
    esac
    if test -n "$_rc_base" -a -x /usr/bin/systemctl ; then
        exec /usr/bin/systemctl $_sd_opts $1 "${_rc_base}.service"
    fi
    unset _rc_base _sd_opts
    fi
    if test -z "$REDIRECT" -a -x /sbin/showconsole ; then
    REDIRECT="$(/sbin/showconsole 2>/dev/null)"
    test -z "$CONSOLE" && CONSOLE=/dev/console
    export REDIRECT CONSOLE
    fi
fi

the telltale line is echo "redirecting to systemctl $1 ${_rc_base}.service" 1>&2

I was able to get phabricator started by defining SYSTEMD_NO_WRAP in 20-postfix:

#!/bin/bash

# Run Postfix
export SYSTEMD_NO_WRAP=true
/etc/init.d/postfix start

I can submit a PR if this is an acceptable solution.

hach-que commented 9 years ago

Yes, that's a good solution.

On Wed, Oct 14, 2015, 00:27 robwiss notifications@github.com wrote:

It looks like opensuse does something to redirect calls to /etc/init.d scripts to systemd.

From /etc/rc.status:

Check if the service is used under systemd but not started with

if test -z "$SYSTEMD_NO_WRAP" && /usr/bin/mountpoint -q /sys/fs/cgroup/systemd; then if test $PPID -ne 1 -a $# -eq 1 ; then _rc_base= _sdopts= case "$0" in /etc/init.d/boot.) _rcbase=${0##/boot.} ;; /etc/init.d/|/etc/rc.d/) _rcbase=${0##/} ;; /rc_) if test -L "$0"; then _rc_base=readlink "$0" _rc_base=${_rcbase##/} case "$_rcbase" in boot.) _rc_base=${_rc_base#boot.} esac else _rc_base=${0##/rc} fi ;; esac case "$1" in status) SYSTEMD_NO_WRAP=1 "$0" "$1" _sd_opts='--lines=0 --full --output=cat' ;; start|stop|reload|restart|try-restart|force-reload) echo "redirecting to systemctl $1 ${_rc_base}.service" 1>&2 ;; *) unset _rc_base esac if test -n "$_rc_base" -a -x /usr/bin/systemctl ; then exec /usr/bin/systemctl $_sd_opts $1 "${_rc_base}.service" fi unset _rc_base _sd_opts fi if test -z "$REDIRECT" -a -x /sbin/showconsole ; then REDIRECT="$(/sbin/showconsole 2>/dev/null)" test -z "$CONSOLE" && CONSOLE=/dev/console export REDIRECT CONSOLE fi fi

the telltale line is echo "redirecting to systemctl $1 ${_rc_base}.service" 1>&2

I was able to get phabricator started by defining SYSTEMD_NO_WRAP in 20-postfix:

!/bin/bash

Run Postfix

export SYSTEMD_NO_WRAP=true /etc/init.d/postfix start

I can submit a PR if this is an acceptable solution.

— Reply to this email directly or view it on GitHub https://github.com/hach-que-docker/phabricator/issues/11#issuecomment-147714027 .