WORKFLOW SNAPSHOT
- Diagnose a command that works interactively but fails when run as a scheduled service.
- Suggested starting behavior: Static assignment
- Validate the real application and destination
A practical Linux workflow
Diagnose a command that works interactively but fails when run as a scheduled service.
- Record the service user and effective configuration source.
- Check whether proxy and bypass settings reach the process.
- Use a minimal request under the same execution context.
Which Linux process reads the proxy configuration?
Keep one assignment while comparing the interactive command and the failing scheduled process. Environment variables, service configuration and library options can differ. Identify the sender’s configuration source instead of assuming a shell export reaches every process.
What should match between a Linux shell, service and container?
Shell variables in your terminal are not proof that a background service inherited them. A bypass rule can also send selected destinations directly.
Compare the observed exit from both execution contexts and redact environment values before sharing logs.
Verify the Linux connection boundary
Record executable or library version, execution user, environment source, bypass rules and any container boundary. A working curl command does not prove that a service using another library reads the same options.
Reproduce a Linux service fetch with the same target
Fetches a fixed diagnostic document from the process running this sample, giving you a response fingerprint to compare between the interactive shell and the affected Linux job.
- 01Generate your endpoint
Choose HTTP / HTTPS and Sticky session for the complete workflow in Configure proxies.
- 02Set your proxy URL
Set
PS_PROXY_URLtohttp://USERNAME:PASSWORD@HOST:PORTusing your generated endpoint. For IP authentication, whitelist your machine and usehttp://HOST:PORT. Percent-encode special characters in credentials; these are proxy credentials, separate from your account password or API key. - 03Choose the destination
Set
Example URL · replace placeholders with your targetPS_TARGET_URLbefore running the code. Use a small HTTPS document you control that the affected shell, service or container is permitted to retrieve; use the identical URL in each execution context.https://example.com/diagnostics/linux-service.htmlSet PS_EXPECT_TEXT to a non-secret fixture label in your diagnostic document. This optional check inspects the returned text without running JavaScript.
Python 3.10+ · python -m pip install requests · python ps_linux.py# Fetches a fixed diagnostic document from the process running this sample, giving you a response fingerprint to compare between the interactive shell and the affected Linux job.
# Use a small HTTPS document you control that the affected shell, service or container is permitted to retrieve; use the identical URL in each execution context.
import hashlib
import json
import os
import time
from pathlib import Path
from urllib.parse import urlsplit
import requests
class InspectSession(requests.Session):
# Leave redirect bodies streamed instead of preparing the next request.
def resolve_redirects(self, *args, **kwargs):
return iter(())
proxy = os.environ["PS_PROXY_URL"] # HTTP endpoint from ProxySight
target = os.environ["PS_TARGET_URL"] # https://example.com/diagnostics/linux-service.html
if urlsplit(proxy).scheme != "http":
raise ValueError("Use your generated HTTP proxy endpoint for this example.")
if urlsplit(target).scheme not in ("http", "https"):
raise ValueError("PS_TARGET_URL must be an HTTP or HTTPS URL.")
with InspectSession() as client:
client.trust_env = False # No ambient proxy, NO_PROXY or netrc overrides
started = time.monotonic()
with client.get(
target,
proxies={"http": proxy, "https": proxy},
headers={"Accept-Language": "en-US,en;q=0.9"},
timeout=(10, 20), allow_redirects=False, stream=True,
) as response:
body = bytearray()
for chunk in response.iter_content(16384):
body.extend(chunk)
if len(body) > 1048576:
raise RuntimeError("Response exceeds this example's 1 MiB limit.")
Path("linux-service-response.html").write_bytes(body)
print(json.dumps({
"workflow": "linux", "status": response.status_code,
"elapsed_ms": round((time.monotonic() - started) * 1000),
"bytes": len(body), "sha256": hashlib.sha256(body).hexdigest(),
"headers": {name: response.headers.get(name) for name in ['Content-Type', 'Content-Language', 'Location']},
}, indent=2))
expected = os.getenv("PS_EXPECT_TEXT", "")
if expected:
text = body.decode(response.encoding or "utf-8", errors="replace")
print("Expected text:", "found" if expected in text else "absent")
# A 200 status alone does not prove the intended page was returned.
# Inspect redirects, login prompts, 403 and 429 before another request.
Compare status, type, cache headers, byte count and body hash while holding the target and assignment steady. Run the sample under the actual service user or container; success in a terminal does not prove another process inherited its proxy configuration.
Response bodies are limited to 1 MiB for a small diagnostic. TLS verification stays enabled; redirects are left for you to inspect. Connection guide
Example: compare an interactive command with a service job
When a command works in a terminal but not as a service, compare the effective user, environment, configuration source, and bypass rules. Run the same minimal request in the actual execution context.
Do not paste the full environment into a report: it may contain credentials. Record which settings are present and the observed result after redaction.
{
"execution": "SERVICE_OR_SHELL",
"user_context": "RECORD_CONTEXT",
"config_source": "RECORD_SOURCE",
"observed_exit": "RECORD_EXIT"
}Linux verification checklist
For this Linux workflow, record execution user, configuration and request alongside the actual result. Use the evidence below to decide whether another observation is comparable before increasing the workload.
| Checkpoint | Hold constant or record | Expected evidence |
|---|---|---|
| Execution user | Interactive or service identity | Correct context |
| Configuration | Proxy and bypass source | Effective settings understood |
| Request | Same URL and timeout | Comparable route observation |
Troubleshoot Linux results and connection errors
| Symptom | Check next | What the result tells you |
|---|---|---|
| Terminal works, service fails | Check inherited settings | The service may not share the shell environment |
| Only some destinations go direct | Inspect bypass rules | The behavior may be deliberate |
| Container differs from host | Verify its egress and settings | Another network context applies |
Reproduce the request under the same Linux execution context
Use the same small destination and timeout under the affected execution context. Record the exit or redacted error, then compare with the interactive baseline. Keep credentials out of process listings, shared unit files and diagnostic exports.
A LITTLE CLARITY
Common questions.
Will setting a shell proxy route every Linux process?
No. Each process or library must use the relevant setting, and some traffic may bypass it.
What is the safest environment evidence to share?
A redacted description of relevant settings and execution context, rather than an unfiltered environment dump.
What should match between a Linux shell, service and container?
Record executable or library version, execution user, environment source, bypass rules and any container boundary. A working curl command does not prove that a service using another library reads the same options.