stubby icon indicating copy to clipboard operation
stubby copied to clipboard

scheduled task fails at startup

Open CarlTuckerson opened this issue 6 years ago • 3 comments

Stubby sometimes failed to start when booting into Windows 10. I modified Stubby.bat to wait for a successful ping response from the gateway on my ISP's network. In the scheduled task that was created when I installed Stubby, I just added my gateway IP address as an argument in the action starting stubby.bat. Stubby.bat is modified as follows:

@echo off

rem Check if an IP address has been specified set IPaddress=%1

rem If not, start as usual If [%IPaddress%]==[] goto :RunStubby

rem If an IP address is specified, wait for a good ping response :loop timeout 2 ping -n 1 %IPaddress% |find "TTL=" || goto :loop

:RunStubby "%~dp0stubby.exe" -C "%~dp0stubby.yml"

When the batch file is run from the task scheduler, stubby.exe isn't run until the IP address specified as an argument there successfully responds to a ping. With no IP address added as an argument, it runs the .exe immediately as usual.

CarlTuckerson avatar May 15 '19 20:05 CarlTuckerson

No matter what I do, I cannot get stubby to start at startup with Scheduled Tasks on Windows 10. I tried with the latest x64 msi. I can run it under my user account (using a Microsoft account login) and get successful dns lookup results.

Chaz6 avatar May 20 '19 15:05 Chaz6

Never used a MSFT account. I created the scheduled task using the the command found in the stubby README.txt, from a command prompt run as administrator. For /RU <your_user_name> I put in my admin username. It failed to run until I edited that to machine_name\admin_username. Then it accepted my admin credentials, and I made sure it was set to run even when the user is not logged on.

CarlTuckerson avatar May 20 '19 16:05 CarlTuckerson

The changes to the batch file did not result in 100% success in Stubby starting from a cold boot. I removed the changes to Stubby.bat and changed the scheduled task settings to:

if the task fails, restart every 1 minute; attempt to restart up to 10 times

Still not 100%. Failed at last startup when I left it at the login screen for a 1/2 hour or so. When I did log in, Stubby was not running, had to manually start the task.

CarlTuckerson avatar May 22 '19 19:05 CarlTuckerson