[Icecast] <on-connect> / <on-disconnect> not working

Petr Pisar petr.pisar at atlas.cz
Fri Jul 15 17:44:21 UTC 2022

V Fri, Jul 15, 2022 at 06:47:56AM -0700, Jack Elliott napsal(a):
> [pid 20995] execve("/home/my_username/bin/email_onconnect.sh", ["/home/my_username/bin/email_onconnec"..., "/stream"], [/* 5 vars */]) = 0

Here email_onconnect.sh is successfully executed (return value 0). Though, it
does not mean that the script won't fail later. Just that the script has

> [pid 20996] execve("/usr/bin/msmtp", ["msmtp", "my_address at org"], [/* 7 vars */]) = 0

Here email_onconnect.sh executed msmtp program.

> [pid 20996] +++ exited with 78 +++

Here msmtp program termined with an exit code 78.

> [pid 20995] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=20996, si_uid=112, si_status=78, si_utime=0, si_stime=1} ---

Here email_onconnect.sh program received a signal that msmtp exited with
details about msmtp exit: It was a regular exit (not a crash), it was running
as user ID 112 and the exit code was 78.

> [pid 20995] +++ exited with 78 +++

Here the exit code is propaged up to a parent process. Probably msmtp was
the last command in email_onconnect.sh.

What does it mean? It means that Icecast successfully executed your
email_onconnect.sh script. But msmtp failed with exit code 78.

I don't know msmtp tool. Its documentation does not explains exit codes
much <https://marlam.de/msmtp/msmtp.html#Exit-code>. It only referes to
sysexits.h header file. That file does not exist in msmtp sources, it seems to
be copied from gnulib sources
There you can read:

    # define EX_CONFIG 78

Gnulib documentation does not explain what EX_CONFIG means. Searching Internet
discloses a similar header file <https://gist.github.com/bojanrajkovic/831993>
from BSD which is more verbose:

    #define EX_CONFIG	78	/* configuration error */

So very probably msmtp tool tries to report an error in a configuration.

I recommend you to study msmtp documentation to know how to enable logging in
msmtp and where to read the log. Debian has a brief introduction
<https://wiki.debian.org/msmtp>. You probably want to set "logfile" option to
a writable file and then watch what will emerge in that file.

You could also log standard output and error output of msmtp command in your
email_onconnect.sh script. Like this:

    msmtp "my_address at org" >/tmp/log 2>&1

Maybe you will find something interesting.

-- Petr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.xiph.org/pipermail/icecast/attachments/20220715/71c438bf/attachment.sig>

More information about the Icecast mailing list