Skip to content
This repository has been archived by the owner on Aug 25, 2019. It is now read-only.

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

Closed
lsyoyo opened this issue Sep 17, 2015 · 5 comments · Fixed by #12
Closed

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

lsyoyo opened this issue Sep 17, 2015 · 5 comments · Fixed by #12

Comments

@lsyoyo
Copy link

lsyoyo commented Sep 17, 2015

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
Copy link

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

@abcfy2
Copy link

abcfy2 commented Oct 13, 2015

Same issue here, how to fix?

@hach-que
Copy link
Contributor

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
#11 (comment)
.

@robwiss
Copy link
Contributor

robwiss commented Oct 13, 2015

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
Copy link
Contributor

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=
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.


Reply to this email directly or view it on GitHub
#11 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants