1. Caddy version (caddy version
):
v2.4.3 h1:Y1FaV2N4WO3rBqxSYA8UZsZTQdN+PwcoOcAiZTM8C0I=
2. How I run Caddy:
Windows task scheduler, using a local user account without administrative privileges.
a. System environment:
Windows Server 2016 Standard [Version 10.0.17763.2029]
b. Command:
D:\Server\Caddy\caddy_windows_amd64.exe reload --config "D:\Server\Caddy\Caddyfile"
c. Service/unit/compose file:
$ProcessPath = "D:\Server\Caddy"
$ProcessExe = "caddy_windows_amd64.exe"
$ProcessName = "caddy_windows_amd64"
$ProcessConfig = "Caddyfile"
try {
$Process = Get-Process -Name $ProcessName -ErrorAction Stop
if ($Process) {
Start-Process -WorkingDirectory $ProcessPath -FilePath "$($ProcessPath)\$($ProcessExe)" -ArgumentList "reload --config ""$($ProcessPath)\$($ProcessConfig)""" -ErrorAction Stop
}
}
catch [Microsoft.PowerShell.Commands.ProcessCommandException] {
try {
Start-Process -WorkingDirectory $ProcessPath -FilePath "$($ProcessPath)\$($ProcessExe)" -ArgumentList "run --config ""$($ProcessPath)\$($ProcessConfig)""" -ErrorAction Stop
}
catch {
exit 1
}
}
catch {
exit 1
}
exit 0
d. My complete Caddyfile or JSON config:
pineae.org {
#respond "It works!"
#respond "Reload worked!"
respond "Reload worked again!"
header { Strict-Transport-Security max-age=31536000; }
}
3. The problem I’m having:
Each time I run the above command, a new process is spawned and none of them ever exit. If I run it 10 times, there are 10 instances of Caddy running simultaneously.
4. Error messages and/or full log output:
I can find no errors in any logs.
5. What I already tried:
If I add the user account to the Administrators group, and the above command functions as expected where simultaneous process do not persist.