0

When systemd tries to start postfix, I see:

окт 11 15:19:28 fs.tld local[32063]: fatal: execl /bin/sh: Permission denied

I also can't start mysql and redis-server; everything else seems fine.

    # systemctl status mysql.service
    ● mysql.service - MySQL Community Server
       Loaded: loaded (/lib/systemd/system/mysql.service; enabled)
       Active: activating (start-post) (Result: exit-code) since Вс 2015-10-11 16:57:29 MSK; 1min 54s ago
      Process: 18410 ExecStart=/usr/bin/mysqld_safe (code=exited, status=203/EXEC)
      Process: 18406 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
     Main PID: 18410 (code=exited, status=203/EXEC);         : 18411 (mysql-systemd-s)
       CGroup: /system.slice/mysql.service
               └─control
                 ├─18411 /bin/bash /usr/share/mysql/mysql-systemd-start post
                 └─18754 sleep 1

    окт 11 16:57:29 fs.annett systemd[18410]: Failed at step EXEC spawning /usr/bin/mysqld_safe: Permission denied
    окт 11 16:57:29 fs.annett systemd[1]: mysql.service: main process exited, code=exited, status=203/EXEC

    root@fs:/etc/init.d# journalctl -xn
    -- Logs begin at Сб 2015-10-10 21:58:00 MSK, end at Вс 2015-10-11 16:58:11 MSK. --
    окт 11 16:56:20 fs.annett postfix/local[18165]: 7B5A31355: to=, orig_to=, relay=local, delay=24439, delays=24439/0.07/0/0.03, dsn=4.3.0, status=deferred (temporary failur
    окт 11 16:57:29 fs.annett systemd[1]: mysql.service start-post operation timed out. Stopping.
    окт 11 16:57:29 fs.annett systemd[1]: Failed to start MySQL Community Server.
    -- Subject: Unit error mysql.service
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --.
    -- Произошел сбой юнита mysql.service.
    --.
    -- Результат: failed.
    окт 11 16:57:29 fs.annett systemd[1]: Unit mysql.service entered failed state.
    окт 11 16:57:29 fs.annett systemd[18410]: Failed at step EXEC spawning /usr/bin/mysqld_safe: Permission denied
    -- Subject: Не удалось запустить процесс /usr/bin/mysqld_safe
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --.
    -- Error: can't start process /usr/bin/mysqld_safe.
    --.
    -- Error code: 13.
    окт 11 16:57:29 fs.annett systemd[1]: mysql.service: main process exited, code=exited, status=203/EXEC

    # strace -f -e execve ./postfix start
    execve("./postfix", ["./postfix", "start"], [/* 31 vars */]) = 0
    Process 32289 attached
    [pid 32289] execve("/bin/run-parts", ["run-parts", "--lsbsysinit", "--list", "/lib/lsb/init-functions.d"], [/* 31 vars */]) = 0
    [pid 32289] +++ exited with 0 +++
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32289, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
    Process 32290 attached
    [pid 32290] execve("/bin/readlink", ["readlink", "-f", "./postfix"], [/* 31 vars */]) = 0
    [pid 32290] +++ exited with 0 +++
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32290, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
    Process 32291 attached
    [pid 32291] execve("/bin/systemctl", ["systemctl", "-p", "CanReload", "show", "postfix.service"], [/* 31 vars */]) = 0
    [pid 32291] +++ exited with 0 +++
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32291, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
    Process 32292 attached
    [pid 32292] execve("/bin/systemctl", ["systemctl", "-p", "LoadState", "show", "postfix.service"], [/* 31 vars */]) = 0
    [pid 32292] +++ exited with 0 +++
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32292, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
    Process 32293 attached
    [pid 32293] execve("/usr/bin/tput", ["/usr/bin/tput", "hpa", "60"], [/* 31 vars */]) = 0
    [pid 32293] +++ exited with 0 +++
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32293, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
    Process 32294 attached
    [pid 32294] execve("/usr/bin/tput", ["/usr/bin/tput", "setaf", "1"], [/* 31 vars */]) = 0
    [pid 32294] +++ exited with 0 +++
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32294, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
    [....] Starting postfix (via systemctl): postfix.serviceProcess 32295 attached
    [pid 32295] execve("/bin/systemctl", ["/bin/systemctl", "start", "postfix.service"], [/* 31 vars */]) = 0
    Process 32296 attached
    [pid 32296] execve("/bin/systemd-tty-ask-password-agent", ["/bin/systemd-tty-ask-password-ag"..., "--watch"], [/* 31 vars */]) = 0
    ^CProcess 32288 detached
    Process 32295 detached
    Process 32296 detached

It then freezes at "/bin/systemd-tty-ask-password-agent"

It's my own debian 8 server; permissions are fine:

    # ll /bin/sh /bin/dash
    -rwxr-xr-x 1 root root 125400 ноя  8  2014 /bin/dash
    lrwxrwxrwx 1 root root      4 ноя  8  2014 /bin/sh -> dash
  • 2
    Possible it's an SELinux issue. Issue sestatus and include the output? – Tom Hunt Oct 12 '15 at 20:27
  • What prompted you to say "maybe i've lost some SUID flags but dunno where"? Did you run something that might have removed SUID flags, or was it just a guess? – Jeff Schaller Oct 12 '15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.