#StackBounty: #magento2.3 #cron #magento2.4 #rabbit-mq RabbitMQ and cron_consumers_runner

Bounty: 50

If you are running RabbitMQ in M 2.3/2.4 and have the env.php section set up for amqp:

    'queue' => [
    'amqp' => [
        'host' => '127.0.0.1',
        'port' => '5672',
        'user' => 'abc',
        'password' => 'def',
        'virtualhost' => '/',
        'ssl' => 'false',
        'ssl_options' => [

        ]
    ]
],

do you remove the cron_consumers_runner section from env.php? Or set it to false? Or trim it down to only specific consumers? Just trying to understand the relationship between the 2 sections. A full cron_consumers_runner section may include:

    'cron_consumers_runner' => [
    'cron_run' => true,
    'max_messages' => 20000,
    'consumers' => [
        'product_action_attribute.update',
        'product_action_attribute.website.update',
        'codegeneratorProcessor',
        'exportProcessor',
        'inventory.source.items.cleanup',
        'inventory.mass.update',
        'inventory.reservations.cleanup',
        'inventory.reservations.update',
        'quoteItemCleaner',
        'inventoryQtyCounter',
        'async.operations.all'
    ]
],


Get this bounty!!!

#StackBounty: #cron #sendmail sendmail Authorization failed in cron jobs

Bounty: 50

When I search for ‘cron’ in /var/sys/syslog I get some lines as follows:

Oct  2 11:10:02 hplaptop cron[141532]: sendmail: Authorization failed (534 5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor d5sm1019803wrb.28 - gsmtp)
Oct  2 11:11:01 hplaptop cron[141579]: sendmail: Authorization failed (534 5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor i11sm1042743wre.32 - gsmtp)
Oct  2 11:12:01 hplaptop cron[141623]: sendmail: Authorization failed (534 5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor x2sm1028990wrl.13 - gsmtp)
Oct  2 11:13:02 hplaptop cron[141662]: sendmail: Authorization failed (534 5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor f23sm1006111wmf.6 - gsmtp)

I’ve never used that program or a similar command to send emails. What do these error messages mean? is it a malware trying to send mail?


Get this bounty!!!

#StackBounty: #linux #ubuntu #cron #raspberry-pi #jenkins Play sound from Jenkins script

Bounty: 50

I run Jenkins on Ubuntu Mate on a Raspberry Pi 2 which has sound hardware (via HDMI).

When connected via SSH, sounds works great.

However, it does not work via Jenkins. I tried an espeak 'hi', the build succeedes, but it does not actually produce any sound at all in the speakers.

I assume the current behavior is the default Jenkins behavior, but I would like to be able to play audio files during the build (every hour).

How can I do that?


Get this bounty!!!

#StackBounty: #bash #cron #startup #pm2 Delay start of process with pm2 until cron time

Bounty: 50

I’m setting up two scripts to use pm2 to restart all our processes at 8:00pm on Saturday on all servers, and stop all processes at 10:00pm everyday on the dev server. This is to help control resource use for ongoing processes, as well as remove processes that are not used often in development.

So far, I have the pm2 config to prevent an autorestart, and then run two scripts on a cron_restart schedule, which restart and stop the services with some separation between them. They work fine together, but I need to account for when the server reboots, or if the service ever goes down and I need to bring it back up; at that initial start, both services will restart at the same time. As such, I would rather delay the start of both services until their proper Cron schedule. I know that pm2 has restart_delay, but that seems to work like sleep and is for the restart, not the initial start up. Has anyone ever had a use-case like this?

My scripts are as follows:

pm2_config.json

{
  "apps" : [
    {
      "name" : "pm2restart",
      "script" : "restart.sh",
      "cron_restart": "0 19 * * Sat",
      "autorestart": false,
      "pid_file": "~/apps/pm2appcontrol/bin/pm2restart.pid",
      "out_file": "~/apps/logs/pm2appcontrol/pm2restart.log",
      "error_file": "~/apps/logs/pm2appcontrol/pm2restart.log",
      "log_date_format" : "YYYY-MM-DD HH:mm:ss"
    },
    {
      "name" : "pm2stop",
      "script" : "stop.sh",
      "cron_restart": "0 21 * * *",
      "autorestart": false,
      "pid_file": "~/apps/pm2appcontrol/bin/pm2stop.pid",
      "out_file": "~/apps/logs/pm2appcontrol/pm2stop.log",
      "error_file": "~/apps/logs/pm2appcontrol/pm2stop.log",
      "log_date_format" : "YYYY-MM-DD HH:mm:ss"
    }
  ]
}

This is run with the script:

#!/bin/bash

pm2 start ./pm2_config.json

The two scripts in the config file are simply:

#!/bin/bash

#pm2restart


for appName in $HOME/apps/* ; do
    service=$(basename "$appName")
    if [ $service != pm2apprestart ] && [ $service != haproxy ]
    then
        echo "Restarting $service"
        pm2 restart /$service/
    else
        echo "======================"
        echo "Skipping $service"
        echo "======================"
    fi
done

and

#!/bin/bash

#pm2stop

for appName in $HOME/apps/* ; do
    service=$(basename "$appName")
    if [ $service != pm2apprestart ] && [ $service != haproxy ]
    then
        echo "Stopping $service"
        pm2 stop /$service/
    else
        echo "======================"
        echo "Skipping $service"
        echo "======================"
    fi
done


Get this bounty!!!

#StackBounty: #linux #debian #cron flock command in root cron won't execute

Bounty: 50

I’ve got the following code in my root crontab on my Debian

* * * * * flock -xn /absolute/path/to/run.lock -c cd /absolute/parth/to/project && ./run >> run.log

But I see no run.log or run.lock files where I specify them. In fact, there’s no evidence the script was executed.

Running ps aux | grep run only yields that grep call.

How do I run the run script using flock in the root crontab?


Get this bounty!!!

#StackBounty: #linux #debian #cron flock command in root cron won't execute

Bounty: 50

I’ve got the following code in my root crontab on my Debian

* * * * * flock -xn /absolute/path/to/run.lock -c cd /absolute/parth/to/project && ./run >> run.log

But I see no run.log or run.lock files where I specify them. In fact, there’s no evidence the script was executed.

Running ps aux | grep run only yields that grep call.

How do I run the run script using flock in the root crontab?


Get this bounty!!!

#StackBounty: #linux #debian #cron flock command in root cron won't execute

Bounty: 50

I’ve got the following code in my root crontab on my Debian

* * * * * flock -xn /absolute/path/to/run.lock -c cd /absolute/parth/to/project && ./run >> run.log

But I see no run.log or run.lock files where I specify them. In fact, there’s no evidence the script was executed.

Running ps aux | grep run only yields that grep call.

How do I run the run script using flock in the root crontab?


Get this bounty!!!

#StackBounty: #cron #zfs #lxc #devuan #rc.local LXC container will start at the command line, but not automatically, from cron's @r…

Bounty: 50

I can always start my container successfully with:

fadedbee@host:~$ sudo lxc-start -n mycontainer

It used to start automatically, until I bound some directories on a local ZFS to it.

I added the following to /etc/rc.local:

/bin/date >> /var/log/mycontainer.log
/bin/chmod a+r /var/log/mycontainer.log

/usr/bin/lxc-start -o /var/log/mycontainer.log

-l INFO -n mycontainer > /var/log/mycontainer.stdout 2> /var/log/mycontainer.stderr &

The /var/log/mycontainer.log file is created, but only contains the date and nothing else.

I added the following to root’s crontab:

@reboot /usr/bin/lxc-start -o /var/log/mycontainer.log -l INFO -n mycontainer

but that didn’t produce any result either.

I strongly suspect that all of these things are happening before ZFS has finished. Adding a sleep 30 ; to the cron entry didn’t help.

What confuses me is that I get no log stderr, stdout or log output at all.

How can I make my container start automatically, or at least see log output?


Update:

I’ve added:

*/5 * * * * /usr/bin/lxc-start -n mycontainer

to root’s cron, but still it won’t start. The same (sudo’d) command from the bash prompt works. The rest of root’s cron entries are working as expected.


Get this bounty!!!