That's right, after the reset there is no warning on the first "Start PLC now!" but after the second ... a warning/ error 2119 appears.

On the second attempt, the function write  fails with errno=EPIPE.

        written = write(pChildCtx->fdPipeOut, ((char*)szMsg) + offset, len - offset);
        if(written == -1) {
            if(errno == EINTR) {
                continue;  /* call interrupted: retry write */
            }
            if(errno == EPIPE) {
                LogMsg(0, RS_RET_ERR_WRITE_PIPE, LOG_WARNING,
                        "omprog: program '%s' (pid %ld) terminated; will be restarted fd=%d",                         pData->szBinary, (long) pChildCtx->pid,pChildCtx->fdPipeOut);                 cleanupChild(pData, pChildCtx);  /* force restart in tryResume() */
                ABORT_FINALIZE(RS_RET_SUSPENDED);
            }

The question is why is this happening?

I don't understand how you are trying to use omprog. Attaching the contents of your script could help us better understand your use case.

When the PLC is started, the message "Start PLC now!" appears in the messages, and then the script should be executed.
The script writes only the text to a file.
The script and rsyslog configuration has not changed since versions 8.13 and 8.29. There was no such warning/ error 2119 in those versions.


rsyslog.conf - general configuration

rsyslog_user.conf - user configuration

usrevent.conf - event configuration

rsysevent32790 .sh- event script

Regards

Drasko Jagodic


Am 16.06.2022 um 19:55 schrieb Joan Sala:
The warning message simply indicates that rsyslog has detected that the program (.rsysevent32790.sh) has exited.

The way omprog is intended to be used is as follows: it launches the program attaching a pipe to its stdin, the program should continuously read lines (logs) from the pipe, until the pipe gets closed by rsyslog (eof reading from it). If the program exits before that, rsyslog will report that warning message and try to restart the program.

I don't understand how you are trying to use omprog. Attaching the contents of your script could help us better understand your use case.

Regards

Joan Sala


On Mon, Jun 13, 2022, 09:20 d.jagodic via rsyslog <rsyslog@lists.adiscon.com> wrote:

    Hi,

    In the embeded system we use rsyslog 8.2010.(but the same si in
    8.2204)

    Is it possible to prevent the cause of the following warnings?

      rsyslogd: omprog: program '/tmp/.rsysevent32790.sh' (pid 29661)
    terminated; will be restarted [v8.2204.1 try
    https://www.rsyslog.com/e/2119 ]
    rsyslogd: action 'action-34-omprog' suspended (module 'omprog'),
    retry
    0. There should be messages before this one giving the reason for
    suspension. [v8.2204.1 try https://www.rsyslog.com/e/2007 ]
    rsyslogd: action 'action-34-omprog' resumed (module 'omprog')
    [v8.2204.1
    try https://www.rsyslog.com/e/2359 ]


    In parallel with the execution of the script, snmp-trap is sent,

    currently we have a situation where the script is executed once,
    but the
    snmp-trap is sent twice with an interval of about 1 second.


    Kind regards

    Drasko
    _______________________________________________
    rsyslog mailing list
    https://lists.adiscon.net/mailman/listinfo/rsyslog
    http://www.rsyslog.com/professional-services/
    What's up with rsyslog? Follow https://twitter.com/rgerhards
    NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a
    myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT
    POST if you DON'T LIKE THAT.
#!/bin/sh
echo -n "32790 EVT22: Start PLC now!" >> "/tmp/fuse/control/logevt/alarm" 
exit 0
# falcon.conf

# -- Loading modules
$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog   # provides kernel logging support
$ModLoad omprog

$FileOwner root
$FileGroup adm
$PrivDropToGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022

$SystemLogRateLimitInterval 2
$SystemLogRateLimitBurst 50

$WorkDirectory /var/spool/rsyslog

# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/rsys*.conf

$outchannel daemon_rotation,/var/log/daemon.log, 
280000,/usr/share/rsyslog/.daemon_rotation.sh
$outchannel debug_rotation,/var/log/debug.log, 
280000,/usr/share/rsyslog/.debug_rotation.sh
$outchannel kern_rotation,/var/log/kern.log, 
280000,/usr/share/rsyslog/.kern_rotation.sh
$outchannel messages_rotation,/var/log/messages, 
280000,/usr/share/rsyslog/.messages_rotation.sh


*.*                                                             
:omfile:$messages_rotation         # messages
daemon.*                                                        
:omfile:$daemon_rotation           # daemon.log
*.=debug;\
   auth,authpriv.none;\
   news.none;mail.none                                          
:omfile:$debug_rotation            # debug(.log)
kern.*                                                          
:omfile:$kern_rotation             # kernel.log


$IncludeConfig /etc/rsyslog.d/usr*.conf
$ActionFileDefaultTemplate S_Format
$template S_Format," %TIMESTAMP% [%syslogpriority%] %HOSTNAME% 
%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
if $msg contains "Start PLC now!" then {
   $ActionExecOnlyEveryNthTime 1
   $ActionExecOnlyEveryNthTimeTimeout 1
   $ActionExecOnlyOnceEveryInterval 1
   $actionomprogbinary /tmp/.rsysevent32790.sh
   :omprog:;RSYSLOG_TraditionalFileFormat
}
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to