Page 1 of 1

Scheduled Tasks Processing but not showing in admin_process_manager

Posted: Sat 3. Jun 2023, 19:05
by helping_hands1
Regarding task:

Command: nohup php PATH/artisan queue:work --daemon &
Schedule: After server reboot
Owner: redacted (non-root user)


I've scheduled above task, for first time to run, I clicked on Run now from actions. After server reboot, the task message is showing Status: Processing but inside process manager I cannot see the process. So I again click on Run Now from action.
Now it showing two messages but in process manager only one process is running.

Image

I clicked on "Click here to remove all pending and finished tasks at once." but still showing this messages.

Re: Scheduled Tasks Processing but not showing in admin_process_manager

Posted: Sat 3. Jun 2023, 20:05
by 24unix
helping_hands1 wrote: Sat 3. Jun 2023, 19:05 Regarding task:

Command: nohup php PATH/artisan queue:work --daemon &
Schedule: After server reboot
Owner: redacted (non-root user)
Why do you use nohup?
Are you in fear that the local shell loses connection to the host? :)

And: Remove the ampersand, that sends the process to the background. Probably not what the scheduler expects.

Edit: nohup was a workaround for unreliable dialup connections, later replaced by screen and even later tmux.

In a local environment you don't need it.

Re: Scheduled Tasks Processing but not showing in admin_process_manager

Posted: Wed 7. Jun 2023, 18:24
by helping_hands1
Hi,
Thanks for your reply.

But I have to run that task at background that's why I used &.

Re: Scheduled Tasks Processing but not showing in admin_process_manager

Posted: Wed 7. Jun 2023, 18:37
by 24unix
helping_hands1 wrote: Wed 7. Jun 2023, 18:24 Hi,
Thanks for your reply.

But I have to run that task at background that's why I used &.
As I can't glimpse through the code, i just can guess: Scheduled task might always be running in the background.

Did you try it without the ampersand?

None of my background tasks scheduled via keyHelp have the ampersand.